iOS Notifications are not receiving that are sent from the server - ios

First of all may be it will be a duplicate question, but due to curiosity I have asked.
I have an application in which push notifications are used, I have prepared, created all the required things for it and at last I have checked the notifications on this link: https://pushtry.com/. All are working well. NOw the problem is that, when admin wants to send the notification from their admin panel the push notifications are not receiving in iOS device.
I have update all the necessary certificates, pem files, methods for iOS 10 etc, but I don't get received the notifictions from admin panel, as per backend, when we send notifications it shows notification send successfully and showing no error for it. I don't know whats wrong going.
Any sugesstions....

First check all the validations or verifications like certificate, pem file and other things are updated on iOS and backend side. This will ensures that nothing error or fault at both ends.
Now reinstall the app in iOS, Clear all notification ids or apns token table from database. On installing the app, you will see there are few apis token available. Now open your admin panel and test again, it will works correctly.

Firstly I want to confirm which certificate you are used for the app developer or distribution.Because there are different ways for sending the notification for both(developer or distribution). Like I am using php services at backend.When I am using developer certificate my backend developer used 'ssl://gateway.sandbox.push.apple.com:2195', $err,
and when I used distribution certificate he used
//'ssl://gateway.push.apple.com:2195', $err.
Thanks

Related

Testing push notifications on iPhone (APNS)

I have uploaded my SSL certificates to my project, focusing on the aps_development.cer.
When I launch my app, I get prompted asking if I want to allow notifications, so that is working properly. It's that the actual notification is not passing through.
My server appears that it is able to send a notification, and I am sending it to my device token.
I'm assuming it might be something with my code signing in Xcode. Is there something different I should be doing?
Preparing your app for push notifications is a long task. With the information your are giving it is not clear that what you are doing wrong.
When I look at it at first I see that no provisioning profile selected. You can't send push notifications without selecting appropriate provisioning profile.
Also what about your pem files and other stuff like gateway url etc?
You can follow these instructions to make push notifications work.

Bluemix Push Notification service not working anymore?

I have a native iOS Swift app talking to a Node.js Bluemix backend with MobileFirst services (AMA, Cloudant, Push iOS 8), which worked well for over a month. A few days ago I noticed that I could no longer register new devices from the iOS app (IMFPushClient.sharedInstance().registerDeviceToken() responded with a 404).
I knew that changes had been made recently to the MobileFirst services (e.g. the various push services were merged into one), so I figured I should rebind those services. This resolved the registration issue, but I haven't been able to receive push notifications ever since.
This is what I tried:
created a completely new backend with the "MobileFirst Services Starter" boilerplate
cloned the most recent version of the "Bluelist" sample app and configured it for this new backend
issued a new APNs certificate for my bundle ID and uploaded it to the push service
successfully registered for push notifications on my device. I have verified this by calling the /devices REST API (essentially, I followed these steps).
Now every time I use the REST API to send messages (after figuring out that the bearer token approach was replaced with a new "appSecret" header), I get an HTTP 202, but the notification never arrives. Likewise, when I try to send the message through the service's dashboard, I get a success message, but the notification never arrives.
One thing I noted is that the symptoms stay the same even if I don't provide the .p12 certificate to the service, so I wonder if this might be some certificate issue, but I have no idea how to trace this. Also, IIRC the "old" MobileFirst services required me to provide the bundle ID and version of the mobile app, but this seems to be gone now. Any help is greatly appreciated.
We were able to solve the issue above by making sure the sandbox environment was using a sandbox .p12 file. To verify this setting go to the IBM Push Notification Dashboard and click the Configuration tab:
Here you can see the Certificate Type of the .p12 file you have uploaded. Make sure if you are using the Sandbox environment it is listed as Sandbox. Same is true for the Production environment.

iOS 6- APNS issues

I have implemented APNS in my iOS application project (by following Ray Wenderlich's tutorial).
After installing app on my device I am getting an alert that "AppName" would like to send you Push Notification". press "OK" or "Don't allow". I pressed OK.
Now after running code I successfully get device token and then send that device token to my server.
The server guy is saving my device token and sends me a push message, and then he is getting message message sent successfully, but my device is not receiving any message.
It's really becoming difficult for me to figure out where I am going wrong. Some say your certificate might be corrupt. If my certificate is corrupt then how is my app getting a device token?
I am using iPhone3GS(iOS6) device (I know it's really old model).
I have been trying to figure this out for more than a week, but no success.
So guys I need your help to figure where I am going wrong.
Thanks
The app doesn't use the certificate in order to register to APNS and get a device token. Only the server uses the certificate. Therefore it is possible the certificate is corrupt or expired.
It's also possible the server is trying to push to on push environment (sandbox or production) while the app was built with a provisioning profile that contains push entitlements for the other environment.
In addition, make sure the certificate being used by the server belongs to the same push environment that the server is connecting to.

iOS Sending a Push Notification From an iOS App, APNS

Is there anything preventing SENDING a push notification FROM an iOS application? There are reasons for my madness. If so, are there any good examples out there? I have code that should be working and if there is no blocking reason, I will post the code.
I tried on Verizon and AT&T. Would want it over a carrier for now.
Please do not comment on why, etc.
[addition]
This would not be for a public app, testing internal only.
I don't see any reason what this wouldn't work. You'll have to include the push certificate with your application, and your users will have to download a new version of your app every time the certificate expires (which means once a year). You'll also need to send to each device all the device tokens of devices it should send notifications to.
The sending code should be the same as it would be in a server that sends push notifications, but you would have to implement it in objective C.
All in all it doesn't seem like a good idea, since you'll need a server anyway (for each device to get the device tokens of other devices), so it makes more sense that the server will do the sending.
Actually yes - there are a few things that prevent you from sending push notification from iOS.
Even if you manage to install (use in your app) certificates needed to properly connect to Apple's APNS server their policy is to start blocking clients that create many short connections.
So for public app you would need to use a "normal" way of setting up your PHP server that manages communication with APNS. Otherwise many public IP's (devices) using your credentials would lead to blocking your app APNS certificate.
If this would be just for private use then there is no reason not to give it a try.

IOS Push Notifications for multiple Apps from one server

We have 2 apps setup for Push Notifications. (A and B)
There are different profiles for each (of course) and we've generated separate certs for each.
App A receives Push notifications just fine, App B doesn't.
Both are talking to the same server - and it does figure out which app it's sending notifications to and uses the correct cert.
I've noticed that if you install both apps on one device, they both get the same Token (which our server tracks per app.). When the server sends a msg in this case, it sends it twice to the same Token - once with each cert. App A will receive the msg, App B won't.
When sending the msgs to both apps, the Apple server responds that all messages were sent correctly with no errors. But the msg never shows up for the one app.
Any suggestions on where to look?
After much searching and looking, I found this question: Iphone - Multiple Apps, Different App ID, Same Token
It points out that you must use a different .certSigningRequest for each app. I checked with our AppStore guy, and he had used the same one for both certs. He fixed that, and now it works!

Resources