Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / GetPushNotificationToken() problem/bug on iOS devices using AGK 108.21

Author
Message
Space Dream Studios
Competition Prize Winner 2014
14
Years of Service
User Offline
Joined: 3rd Mar 2010
Location:
Posted: 16th Mar 2014 22:53 Edited at: 16th Mar 2014 22:58
Using the GetPushNotificationToken() function returns a "Error" value instead a valid token-string, compiling with AppGameKit 108.21, on iOS devices.... On android the token comes out like usual. Any ideas? Thanks in advance!

Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 16th Mar 2014 22:58
Did you happen to previously decline allowing push? That's the ponly time I've seen it. Also, your trying on a live device, correct?

Space Dream Studios
Competition Prize Winner 2014
14
Years of Service
User Offline
Joined: 3rd Mar 2010
Location:
Posted: 16th Mar 2014 23:06
No, didn't declined before... Trying on a real device iPhone4, iPhone5s and iPad3... Same result on all three devices...
Comes up on the AGKPlayer during development, but know that I had valid results before using the AGKPlayer during testing...

Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 16th Mar 2014 23:09
I'd report it directly to Paul. I'm pretty sure he's working on a patch for 10821 anyway. I stopped at 10819 and know it works properly there. Try compiling with an older version and see what happens.

xGEKKOx
AGK Master
15
Years of Service
User Offline
Joined: 7th Dec 2008
Location: Italy
Posted: 17th Mar 2014 01:52
On Apple the functions used in main.c are deprecated if i'm not wrong.
In fact, i use OBJ C directly since september 2013.

Don't use Extra functions with iOS.
Remember that iOS change every 1/2 months, never use functions that can change like Game Center, Push notifications, iAD, etc...

Long life to Steve!
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 21st Mar 2014 16:45
Space Dream Studios emailed me and we narrowed it down to the following error "found no valid aps-environment-entitlement-charstring". He found the following solution

Quote: "
Since I updated my XCode environment to the latest version 5.1 days ago, it looks like it needs some additional settings in the Capabilities tab in Xcode:

Background Modes ON: CHECK Remote notifications
&
Keychain Sharing ON!

Additionally I created and downloaded a new app id and provisioning profile for the agkplayer with push enabled.
"
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 21st Mar 2014 17:08
Thank you!
This is a bit concerning. We have background modes OFF and Keychain sharing OFF. We're using the latest xcode release and AppGameKit 10819. In our pre-release tests we were receiving push notifications and tokens were accessible. We did not see a "found no valid aps-environment-entitlement_charstring" error.

Were there changes between 10819 and now that made this difference? Is this an Apple change or is this an AppGameKit change? My concern is that the version we submitted over the weekend.

I'm re-reading Apple's distribution guide and it says:
Quote: "Apple Push Notification service (APNs) allows an app that isn’t running in the foreground to notify the user that it has information for the user. Unlike other capabilities, you don’t configure push notifications in your Xcode project. To enable push notifications, you create an explicit App ID that enables push notifications and a corresponding client SSL certificate.

You can create only one explicit App ID that matches your bundle ID. Therefore, if Xcode created an explicit App ID for you—for example, when you added another capability that requires an explicit App ID—you should use it; otherwise, you create an explicit App ID that matches your bundle ID. You then generate and download a corresponding client SSL certificate—this step fully enables push notifications—and refresh provisioning profiles in Xcode. Later, you install the client SSL certificate and key on your server.

To learn more about using push notifications in your app, read Local and Push Notification Programming Guide.
"

https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/AddingCapabilities/AddingCapabilities.html

So it says that adding capabilities for push is not needed.
Confused and concerned

Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 21st Mar 2014 18:30
I don't know exactly what fixed the issue, but it is likely the last line "a new app id and provisioning profile for the agkplayer with push enabled". If it is working for you then you should be fine.
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 21st Mar 2014 18:41
Ya I think it was an App ID thing and just by turning a new entitlement on it created the missing app ID. XCode seems to have gotten !ore buggy over the past few iterations.
Thanks for helping to allay my concerns. Keep up the great work!

Login to post a reply

Server time is: 2024-05-05 03:45:20
Your offset time is: 2024-05-05 03:45:20