iOS Google Play Service's push notifications is working at this time? - google-play-games

I'm building an iOS game using Google Play Game for turn-based multiplayer but cannot receive any notifications. I did research many days to find what is wrong but i can't find anything.
So is iOS push notification in Google Play game still working at this time? Do your games still receive push notifications normally? Please provide me some information.
Thank you!

It is still indicated in the documentation that invitation and turn notifications are currently supported on Android and iOS. Based from this tutorial, you need to register your app to receive push notifications.
In your appDelegate, add the following code to the callback for retrieving the push device token passed back from APNS. This device token is used for outbound push notifications, and your app must register it with the Google Play games services push service. Make sure to always register your device token through GPGManager to enable push notifications from Google Play games services. Even if the user has not signed in; the GPGmanager object will cache this token and save it until the user signs in.
- (void)application:(UIApplication *)application
didRegisterForRemoteNotificationsWithDeviceToken
:(NSData *)deviceToken {
NSLog(#"Got deviceToken from APNS! %#", deviceToken);
[[GPGManager sharedInstance] registerDeviceToken:deviceToken
forEnvironment:GPGPushNotificationEnvironmentSandbox];
}
From this related thread:
If you are having issues you might want to make sure the token is being registered correctly with APNS in the AppController.m (by logging it).
Also, there are two certificates you can register on the Play console, one for sandbox and one for production. Make sure that certificate you are using is the one being configured. By default the AppController calls
gpg::RegisterDeviceToken(deviceToken, false); which indicates that this is the prod certificate configured on the console.
You can also check this related GitHub issue which might help.

Related

Azure Notification Hub losing the subscribe when app is reinstalled

I have a problem with Azure Notification Hub.
When my app is started in first time, the notifications working correctly, but when did a rebuild the app by Visual Studio, the notifications stop working and the Android Services with IntentFilters do not are called.
For the notifications works again, I need to uninstall the App in Android and run by Visual Studio again.
Have someone some idea about that problem?
My worry is: if I send the app to GooglePlay, the notifications would continue working after a update?
If someone know how to call the service to get the new InstallationId, always that the app to be started I will know how I can resolve the problem.
Can someone help me?
I did follow that tutorial:
https://www.youtube.com/watch?v=le2lDY22xwM&t=3312s
if I send the app to GooglePlay, the notifications would continue working after a update?
There is no need to worry about that, referring to this document, when you use Azure Notification Hub, it's using Android GCM to send the push notificcation. You could see my answer about Android using Firebase Cloud Messaging not receiving message.
As the Official document said :
On initial startup of your app, the FCM SDK generates a registration token for the client app instance. If you want to target single devices or create device groups, you'll need to access this token.
Explanation about Token :
An ID issued by the GCM connection servers to the client app that allows it to receive messages.
When you did a rebuild the app by Visual Studio your token is changed, but it didn't trigger the OnTokenRefresh method, so at this time the Token in your application is invalid. That's why your application cannot receiving message.
For more information, you could refer to Sending Push Notifications from Azure Mobile Apps and Implement the Firebase Instance ID Service.
When your app get a update, it will trigger the OnTokenRefresh method automatically, so your application can still receive the message.

Get notified about changes in a google calendar

I was wondering, is it possible to set up a Mac OS X app, to get notified when a user makes changes to a Google Calendar. Like what you can do with EKEventStore?
There’s a query method + (id)queryForCalendarListWatchWithObject:(GTLCalendarChannel *) object, but I’m not really sure how you should set up the GTLCalendarChannel object.
Or is the only way, other than polling, to use push notifications?
Thanks in advance.
You can use Google Calendar API which provides push notifications that let you watch for changes to resources. This makes periodic polling unnecessary.
You can use this feature to improve the performance of your application. It allows you to eliminate the extra network and compute costs involved with polling resources to determine if they have changed. Whenever a watched resource changes, the Google Calendar API notifies your application.
To use this API, you need to:
Register the domain of your receiving URL. Before you can set up a push notification channel, you must register the domain for any URLs you plan to use to receive push notification messages.
Set up your receiving URL, or "Webhook" callback receiver. Whenever a watched resource changes, your application will receive a notification message describing the change. The Google Calendar API sends these messages as HTTPS POST requests to the URL you specified as the "address" for this notification channel.
Set up a notification channel for each resource endpoint you want to watch. To request push notifications, you need to set up a notification channel for each resource you want to watch. After your notification channels are set up, the Google Calendar API will inform your application when any watched resource changes.
When a calendar changes, it will notify your app and the app does an API call to get the update. You can use one of the Google API client libraries to utilize push notifications.
Check these documentation and blog about Google Calendar API Push notifications.
Hope this helps!

Using Swift 2 won't allow iOS 8 devices to Register for Push Notifications

I am configuring push notifications on for iOS using Xcode 7 and Parse. The notifications are working perfectly on a device running iOS 9.
But when running the application on a device with iOS 8, I am running into problems. I am unable to get the Alert View where the user can select to "Allow Notifications from App X".
But, the device token registration call is being called successfully when the user opts in to push notifications and the device is successfully registering an Installation object with a valid device token. Notifications are also being sent to the device.
If I go into Settings->Notifications->My App and turn the Notifications On or Off, it doesnt make a difference the notifications are still being sent through.
This is the code I am using to register for notifications:
let settings = UIUserNotificationSettings(forTypes: UIUserNotificationType([.Alert, .Badge, .Sound]), categories: nil)
application.registerUserNotificationSettings(settings)
application.registerForRemoteNotifications()
Found the solution here on stackoverflow... Registration for notifications are sent only once on devices running versions older than iOS 9.
As answered by another user here...
"The first time a push-enabled app registers for push notifications, iOS asks the user if they wish to receive notifications for that app. Once the user has responded to this alert it is not presented again unless the device is restored or the app has been uninstalled for at least a day."
OR
"If you want to simulate a first-time run of your app, you can leave the app uninstalled for a day. You can achieve the latter without actually waiting a day by setting the system clock forward a day or more, turning the device off completely, then turning the device back on."
Reference Links:
Push Notification ON or OFF Checking in iOS
https://developer.apple.com/library/ios/technotes/tn2265/_index.html#//apple_ref/doc/uid/DTS40010376-CH1-TNTAG42

Query on push notification plaforms

How does push notification platforms check if the app credentials(Android - app key, project id // ios - certificate etc) provided by user are genuine or not. Do they validate this at the time of app registration or while pushing a notification on to GCM - Google cloud , APN - Apple push
I don't know the specifics for GCM but I assume it's similar to Apple: every time you try to send a push notification, you need to connect to Apple's servers with the Push Certificate that you will have generated between them and you. The validity of the certificate is checked for every single call that you make to their servers.

Coding Issue while registerForRemoteNotificationTypes

I had a support for push notification "registerForRemoteNotificationTypes" in my app which is under a macro "EnablePushNotification". That means only if I enable this macro, then my "registerForRemoteNotificationTypes" will be executed.
I have recently submitted my app to Apple Appstores, and they have sent me a warning as below:
"Missing Push Notification Entitlement - Your app appears to register with the Apple Push Notification service, but the app signature's entitlements do not include the "aps-environment" entitlement. If your app uses the Apple Push Notification service, make sure your App ID is enabled for Push Notification in the Provisioning Portal, and resubmit after signing your app with a Distribution provisioning profile that includes the "aps-environment" entitlement.
If you would like to update your binary for this app, you can reject this binary from the Binary Details page in iTunes Connect. Note that rejecting your binary will remove your app from the review queue and the review process will start over from the beginning when you resubmit your binary."
My question is that I had not enabled this macro "EnablePushNotification" so "registerForRemoteNotificationTypes" will never get executed. Also I had not enabled my appstores provisioning profile for push notification. Even then i got this warning. What might be the issue here? Help appreciated.
I think you should also put under macro following UIApplicationDelegate methods
application:didReceiveRemoteNotification:
application:didRegisterForRemoteNotificationsWithDeviceToken:
application:didFailToRegisterForRemoteNotificationsWithError:

Resources