Pushnotification not received when install ipa file - ios

Pushnotification not received when install ipa file using developer mode.
Two days before it was work fine.
I am able to receive pushnotification if install via Xcode. But, not receives after makes ipa file (Budle Id and code signing part is correct).
I have tested the following websites too,
http://pushtry.com/
http://apns-gcm.bryantan.info/

When you take build from Xcode it will be development mode. And you stated "I am able to receive pushnotification if install via Xcode".So that means in server side development APNS certificate is implemeted and the certificate is valid.
So check following:
1) While taking IPA file(archiving), are you taking development build (see ).
If you take other builds then you need to implement distribution APNS certificate in the server, coz the IPA will be distribution/production build.

Things to Consider in Push Notification
Development Mode , Certificate in server must be development. And send push to tls://gateway.sandbox.push.apple.com:2195
Any mismatch will cause push not receiving issue.
https://apn-tester-free.en.softonic.com/mac
you can use this app for testing development.

Related

If push notification can be sent successfully on development device, why the app can't receive the push notification when installed ad-hoc?

I'm developing an app that uses push notification. When tested on development device (e.g. installed using cable connected to the Mac), it can receive push notification correctly. But when it's installed using ad-hoc means, no push notification received.
But, the app can obtain the device id on both development and ad hoc scenario. This is evident by the device id received and recorded on the server. The server receives device id on both development and ad hoc scenario. But even then, if the app is installed using ad hoc means, it's not receiving any push notification from the server.
PS:
I'm using Xcode 8.2.1 and Swift 3.
I have created the certificate using SSL push notification for distribution and development, and have included (double click) the certificate on the Xcode.
I have made sure that the capabilities for push notification is ON. Both steps on push notification are also has ticks.
I archived the app using Xcode automatically manage sign in. Xcode is supposed to linked in all the correct certificates for me, including the certificates for SSL push notification for distribution and development... right?
What is your thought on what's wrong with this, and the solution for this? Thanks.
EDIT:
When I tried to use manual code signing, here's what I got:
I can't resolve the status issue. I know that the debug is supposed to have different provisioning. But for now, that's not the main issue. If I can solve the status issue, I also can solve the different profile.
You need to make sure if the certificates for the push notification in adhoc environment are created fine. Secondly, the UDID is getting saved on server properly or not.
Firstly, you should check your uuid of mobile provision in ipa is correct by running command security cms -D -i yourprovisionname.mobileprovision in bash.
the trailing lines
<key>UUID</key>
<string>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</string>
you can unzip your .ipa file and find embedded.mobileprovision in your Payload/App
If mobileprovision is correct, you should check your certifications.
Note that The certification of production environment is different than sandbox.
After checking the certification, you can check the server side. When we push to a sandbox(development), we push to address gateway.sandbox.push.apple.com, and in the distributed environment, we push to gateway.push.apple.com(no sandbox).

Push notifications don't work in Apple Beta Testing (TestFlight)

Push notifications worked fine with a Development provisioning profile, but once I tried putting the app on the Beta testing programme (TestFlight), they don't.
I tried following all the required steps when switching to a Production profile, but it still doesn't work. Here's what I have.
In the Member Center:
Certificate of type iOS Distribution.
App ID. Named (not wildcard). Push notifications enabled for both Development and Distribution - green lights - with all SSL certificates generated and uploaded.
iOS Distribution Provisioning Profile, that uses the above mentioned Certificate and App ID as well as lists Push Notifications among enabled services.
In XCode. Target > Build Settings > Code Signing:
Provisioning profile - iOS Distribution, same as in Member Center.
Code signing identity (both Debug and Release) - iPhone Distribution.
Am I missing something (not so) obvious? Any help would be greatly appreciated.
Everything seems correct. Maybe you should precise what is not working :
App not registering to APNS token at all
App correctly registering but push not received
Process to the following checks
App not registering to APNS token at all
Mobile Provision
Make sure you refresh your mobileprovisions through XCode after enabling push to be sure those includes the correct entitlements. You can check this by opening the mobile provision in an editor and look for the aps-environment key?
Registration to APNS
make sure the code to register to APNS does not depend on any personal settings (like a Push Id for some SaaS push service that is missing)
.
App correctly registering but push not received
Check that the pushToken received is sent to the correct environment of your server (the one that connect to APNS)
Check that your server is using the Production APNS Certificate
As it happens, I failed to provide full context in my question. I use Parse.com to handle my backend as well as push notifications. So what I was missing was a production certificate on Parse.com, not just a development one. So, if anyone else is using Parse and ran into a similar problem, I hope this is helpful.

APN works in development not in distribution

We have an iPhone app that uses APN, the testing was perfect on sandbox, now the problem we are seeing is that APN is not reaching the phone on production, is this a known issue on the iPhone? Our app was just approved two days ago.
We checked everything mentioned here,
I understand this question is very hard to answer and I guess what I'm looking for is any hints.
This is what I made sure of:
I am using different APN token for production than development
The provisioning profile has Push Notifications enabled
Apple APN service responds successfully without and don't report any issue.
Certificates seems to be fine. And when I unzip the ipa I see aps-environment refers to production in the distribution ipa.
Downloaded the Store ipa and unpacked it, yet to find that it also has the aps-environment set to production.
UPDATE:
I removed all the certificates and provisioning profiles and created a new Production/Distribution certificate with Push Notification support.
Now, when I installed the store version, the APN didn't work still. However, I used the latest Ad-Hoc built I have locally and the APN is working fine. I decided to replace the Ad-Hoc with the Store version, and behold, the APN started to work. I am not sure what's the issue, I'll have to check on other phones to see if it really works. Have anyone had similar scenario?
Old question, but I had the same troubles.
Just found this link: iPhone iOS push notifications apns on production not sending
For production you need a different URL to push your notifications:
ssl://gateway.sandbox.push.apple.com:2195 Development
ssl://gateway.push.apple.com:2195 Production
This fixed it for me.

Push notifications not received via TestFlight

My app is currently being tested by testers via TestFlight. The problem is that they don’t receive any push notifications sent. It’s working on my own device when connecting it to my mac and running the app directly from x-code.
I feel like I’ve tried almost everything, from changing certificate from dev to production to recreating a new production APNS certificate and build using a new profile referencing it, etc.
I know this question has been discussed on other topics but I never found the right answer in my case. I can't post images here because I don't have enough reputation but I have relevant screenshots.
Any help is welcome :)
Elements to help diagnostic :
It’s working on my device when I run the app directly from x-code.
The testers are asked properly if they want to authorize push notifications on their devices (at least the first install, after if they want to get asked again they have to do what’s described in Reset push notification settings for app)
The registering is working because I can see their devices tokens in the logs (but I have the feeling that the token is always the same, no matter if the app is built with the production or the dev certificate, not sure if it’s normal).
I have an APNS Production certificate.
I have a distribution profile, with “push notification” enabled. It’s linked with my “full” appID (and not the generic one with “*”).
I’m signin the build in release mode with the distribution certificate (not in debug mode), and I’m using the provisionning profile described above (the distribution one, linked with my app id)
And when I check in the "binary & entitlements" window just before submitting the build I see the the provisionning profile is correct and that "aps-environment" is set to "production".
Server-side : The APNS call is made by using javapns (https://code.google.com/p/javapns/) from a google app engine server. Like I said the notification are correctly received on my own device so I guess this call is working. We have a .p12 file generated from the APNS developpement certificate and a .p12 file from the APNS production certificate, and I've tried to make the call with both and it's not working. The server-side code hasn't change from the previous version and it was working in production with the app on the store. The problem is really focused on testing with testflight.
Thank you all !
If you followed Ray Wenderlich's tutorial and you made everything work in development mode, the issue most likely comes the fact that you now need to create a new .pem-file for production mode.
So, you need to perform exactly the same steps that you did with the development certificate (i.e. the .p12-file) you downloaded once more with the production certificate which you can obtain in the iOS dev center as well:

Push notifications not coming when we download the build from testflight or diawi iOS

I have successfully created the .pem and .p12 file by
http://www.raywenderlich.com/32960/apple-push-notification-services-in-ios-6-tutorial-part-1
Tutorial.
We are using java as a server so I also exported my .p12 key using this link as there was an error of directly exporting the .p12 file
Cannot send push notifications using Javapns/Javaapns SSL handshake failure.
Everything is working great in debug mode. Whenever I install a build by xcode I receive the push notifications successfully everytime. But after archiving and uploading the build on testflight or diawi and then installing it on the device I didn't get any push notifications. I am successfully getting the device token from apns server. On debugging at server side we found that the device token they receive and send the notifications is invalid. This response is sent by the apns server to our java server. . I am using Xcode 6.0 or later and my app is compatible with ios7.0 or later. And yes I have made checks in registering for remote notifications for ios 8 and 7.Has anyone has faced this issue because earlier in xcode 5 series this hasn't happen. Please help
Any help will be appreciated. Thanks
If you followed Ray Wenderlich's tutorial and you made everything work in development mode, the issue most likely comes the fact that you now need to create a new .pem-file for production mode.
So, you need to perform exactly the same steps that you did with the development certificate (i.e. the .p12-file) you downloaded once more with the production certificate which you can obtain in the iOS dev center as well:
Here is the quote from the tutorial that you probably overread:
If you’re ready to release your app to the public, you will have to
repeat this process to make an Ad Hoc or App Store distribution
profile.
1.)Check if the pem file you have stored on your server is created by using a development certificate or distribution certificate, for push notifications to work through ttestflight you need to create a pem file in the distribution mode,
2.) also check if the gateway you are delivering to is gateway.push.apple.com:2195, and not the sandbox one,
3.)the notification tokens are also different for development and distribution profile, check all these scenarios and see
In order for push to work you have to use the exact same AppID for both creating APNs cert and Provisioning Profile. Wildcard profiles cannot be used for push notifications. May this be your problem(using wildcard or just different AppID for TestFlight/diawi)?

Resources