push notification not received by iPad - apple-push-notifications

We are running into an issue with push notification. We are sending alerts to iPad app through apple sand box. From our C# console, it connects to APNS (TCP/IP), authenticates SSL and sends notification. But the device didn't receive anything. Certificate(.pem) generated for development environment and we are sending the notification in ByteArray format. Is there a way to validate the device token?(meaning are we targeting the right device). Also how to retrieve the status through enhanced notification format. Any feedback/suggession would be of great help. Thank you

A couple questions:
How are you sending the notification in byte array format?
Isn't the Notification just a string formatted as Json?
A couple things you should be doing:
Also you can be using the development certificate but in your code you've not set the environment to be sandbox.
And most importantly you should be using a .p12 file as your certificate not a .pem file.
Hope that helps.

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.

iOS Google Play Service's push notifications is working at this time?

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.

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.

Windows Phone 7 - Is it possible to add additional key/values to push notifications messages

I'm testing out Windows Phone 7.5 push notifications. I have got the 3 different push types working fine (Toast, Tile and Raw) and am able to send messages from unit tests and a web application without any problems and receive them in my WP application. I want the ability to add extra properties to the push notification and the Raw push type does this perfectly for me and I can add custom key/value pairs or anything else to the push message and extract it on the phone app. I have just found out however that it only works if the application is running and my unit tests fail (suppressed notification status is received in unit test) when the phone application is not running (checked documentation which confirms this too). Is there anyway to add extra properties (key/values) to toast or tile messages or some way I can use raw in another way ? Toast notifications seem limited to a title property and an actual message property but I need to add additional data.
Just wondering if anyone had any suggestions / workarounds ?
The general practice I use is to initially send a raw notification to the device with phone-usable data embedded in the message. If my application is currently running then I can process the contents of the raw message and immediately make use of it on the phone. However if the application is not currently running on the phone you will receive notification from the push servers that the message could not be delievered. If I receive this response I send out a Toast / Tile notification.
With Toast notifications the only parametrisation you have access to is the URI that will launch the application. This is specified with the wp:param node of the message. Eg.
<wp:Notification xmlns:wp="WPNotification">
<wp:Toast>
<wp:Text1>Toast Title</wp:Text1>
<wp:Text2>Toast sub title</wp:Text2>
<wp:Param>/MainPage.xaml?LaunchedFrom=A%20Toast%20Notification</wp:Param>
</wp:Toast>
</wp:Notification>
If the user taps on this toast notification your application will launch and navigate to MainPage.xaml. You can access the querystring passed in via the NavigationContext.QueryString.
Note: The wp:Param node can only be sent to Mango (and up) devices. Additionally the entire contents must be less than 256 characters or you'll receive a PushErrorTypeMessageBadContent error. (Thanks to Ritch Melton for pointing this out). More info available from the Sending Push Notifications for Windows Phone page on MSDN.
As you've discovered, the Microsoft Push Notification Service is very strict in what types of messages you can send and receive. The intent of these push notifications is to provide simple push updates and not large amounts of data. The flexible Raw type seems like it would fit the bill until you discover that:
You can use a raw notification to send information to your application. If your application is not currently running, the raw notification is discarded on the Microsoft Push Notification Service and is not delivered to the device.
However, if you send a toast notification to your application, when the user clicks on the toast the application is started. When your application starts, you should check a service and retrieve the data you are trying to send from a web-service or other remote mechanism.

How to send email with an attachment using Windows Phone 7 API?

My WP7 application requirement is to send the email with an attachment and use device default SMTP settings.
I have tried EmailComposeTask class but it doesn't have any member for attachment.
The other idea, i am thinking is to upload the file on server and then send the email from that server.
What you think if there is no way to send the email with an attachment using WP7 API?
Your observation is correct, at this point in time EmailComposeTask doesn't support attachments and this is the only facility to send email programatically from the device at the moment.
As you note, you can communicate with a server which can perform this task on behalf of your app.
I found a wp7 and wp8 library that does it: http://www.windowsphonegeek.com/marketplace/components/livemailmessage
Try to create web service to send mail in your webserver. so, we can call the from your app to send mail.
I hope upcoming version it will be possible!
Please check this URL for more details http://forums.silverlight.net/forums/p/209808/493532.aspx
I've found this article, but I did not make any test yet.
From the author:
EmailComposeTask won’t allow you to send attachments, but this doesn’t mean that you cannot send files through it. .NET Framework has these two amazing methods: Convert.ToBase64String and Convert.FromBase64String. The first will allow the developer to convert a byte array (byte[]) to a Base64-encoded string, the other one will do the same operation in reverse.
Reference:
Pushing the Limits of the Windows Phone SDK and Sending Files via EmailComposeTask

Resources