简体   繁体   中英

My App Push Notification is not working in my client's iPhone only

I am developing Mobile Application in iOS and I have successfully done creation of push certificates and server side implementation.

Now the problem is, Push Notification is working perfectly in my iPhone 5S and iPhone 6. I have checked it in many phones in India, it's working fine but when I tested it in my client's iPhone 5S then it's not working. After that my client brought another iPhone 5S and gave me his new device UDID, again its not working. Please help me what is wrong.

After lot of googling I found below steps so that our app can ask again for push notification permission.

  1. Delete the apps who don't have Push notifications any more form the device.
  2. Turn the device off completely and turn it back on.
  3. Go to settings and set date and time ahead a day
  4. Turn the device off again and turn it back
  5. Install the apps again and it'll ask for notification like the first time you installed It.

I followed above steps and device asked for push notification permission but it's still not working in his iPhone.

After that I followed same steps in my iPhone in India in which push notification is already working. After following above steps, my app asked for push notification permission and it's working fine.

Below info may help us in resolving this issue. My Client is in Manchester, United Kingdom and he is using O2 contract based iPhone.

You must be using a development's certificate when testing in your phone and using the sandbox server of the apple for the push notifications, and in the client's case its a deployed application using a deployment certificate so you need to remove the sandbox from the push notification's server in your server side and use the live server. It will then work, I once was stuck in the same problem too. gateway.sandbox.push.apple.com:2195 this is the address for sandbox remove the sandbox from it and you will start getting the notifications on the application that has been made using a deployment's certificate. I hope this helps.

It worked perfectly with the answer suggested by @Ahsan Ebrahim. Here are the proper steps if we want to test APNS on client's devices.

  1. Create Production based APNS Certificate.

  2. Use AdHoc as the IPA Distribution because According to Apple AdHoc is used to "Create a distribution provisioning profile to install your app on a limited number of registered devices." and iOS App Development : "Create a provisioning profile to install development apps on test devices."

    We have to choose AdHoc here so that we can distribute the IPA.

  3. Use production based ck.pem file on server.

  4. Use gateway.push.apple.com:2195 on Server instead of gateway.sandbox.push.apple.com:2195.

Code Sign your Application using AdHoc Distribution and you are done.

After that It will work perfectly.

This is must be issue with the Provisioning file. Please check that you are using right provision when you generate an IPA for your client. I had same issue before that Xcode mistakenly take wildcard mobile provision (Push notification will not work with wildcard mobile provisioning file).The default App ID of my provisioning profile was the auto created "Xcode iOS Wildcard App ID". happy coding .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM