1

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....

Parkhya Dev
  • 125
  • 15
  • some Problem is from backend side so please check one and follow this url for backend https://gist.github.com/joashp/b2f6c7e24127f2798eb2 and double check with your side have you enable push notification in capabilitites? – Bhupat Bheda Oct 09 '17 at 10:17

2 Answers2

3

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.

Gourav Joshi
  • 2,419
  • 2
  • 27
  • 45
2

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

  • Thank you for reply.....I am using development phase, and using this: 'ssl://gateway.sandbox.push.apple.com:2195', And I have make all the necessary updates at iOS side. – Parkhya Dev Oct 09 '17 at 10:24
  • check you Payload from Backend side might be not in well format! – Bhupat Bheda Oct 09 '17 at 10:26
  • Did you check this when your app is at background mode? – Nitesh Kumar Garg Oct 09 '17 at 10:26
  • No, I have not check this type, I am currently testing in foreground mode to ensure that notifications aare receiving – Parkhya Dev Oct 09 '17 at 10:29
  • Did you used this delegate? @available(iOS 10.0, *) func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) { completionHandler([UNNotificationPresentationOptions.alert,UNNotificationPresentationOptions.sound,UNNotificationPresentationOptions.badge]) } – Nitesh Kumar Garg Oct 09 '17 at 10:43
  • @NiteshKumarGarg Yes, My code is updated, all certificates, pem files are also updated, when testing via https://pushtry.com/ notifications are receiving, but not from admin panel. – Parkhya Dev Oct 09 '17 at 10:45
  • It means there is some problem in your admin panel.your service not working properly. – Nitesh Kumar Garg Oct 09 '17 at 10:49
  • @NiteshKumarGarg here is payload format used in backend: $body['aps'] = array( 'alert' => $message, 'ReceivedMessage' =>$notificationType, 'data_array' => $dataArray, 'total_count'=> $totalCount, 'sound' => 'default', ); – Parkhya Dev Oct 09 '17 at 10:57