(iOS Swift) Push notification not showing on device after successful registration

I have successfully registered my device and it is showing in the console, but when I publish a push notification from the console, my device never receives it.

Hi Michael,

Have you configured your application as described in the documentation?

Yes, did all of that.

How can I go about debugging this problem? My app isn’t crashing at all. Also tried pushing programmatically and it printed the message status (so I assume it was successful), but my device isn’t getting the push notification still.

As for another piece of information - whenever I publish in the console, it says “message scheduled”, but it doesn’t appear in the list of Messages. Might be indicative of something?

I’m assigning this to our iOS/Swift developer, he shall contact you here as soon as possible.

Thanks

I had exactly the same issue yesterday. I figured maybe my push certificate was not configured correctly or something. So today I re-did all of the configuration according to the documentation. Now it crashes during device registration.

These things are very hard to debug because there are so many parts. It would help if we could see a server log or something.

Hi,

This issue can be a result of the following causes:

Regards,
Slava

TestPushNotify.zip (19.26MB)

I’ve already followed your docs and this was already done properly. I went through the whole process again and there’s still nothing. It’s rough since I don’t know what else I can do to debug the problem.

Hi Slava —

  1. I downloaded TestPushNotify and unzipped.
  2. I opened the xcworkspace file
  3. I changed the APP_ID & SECRET_KEY in AppDelegate to those found in my App/Manage/App Settings screen
  4. I changed the Bundle Identifier from “com.backendless.PushTeamDev” to “com.letsrohm.Rohm” which matches the App ID & certificate I set up in Apple’s Developer Portal.
  5. I changed the code signing identity to match the identity in my keychain that corresponds to the p12 certificate file I have uploaded to my App/Manage/App Settings.
  6. Run the app on an iPhone 6S, it says there is a signing issue, do I want to fix it? Yes I do. The app runs.
  7. TestPushNotify runs and prints:

didRegisterForRemoteNotificationsWithDeviceId: 5AE203B7-F2C0-FA94-FFC0-9B9DB254FF00

PUBLISHED

Message has been sent: <MessageStatus> messageId: 1E986FEE-B2CB-8D52-FFB2-6EC98FB40700, status: SCHEDULED errorMessage: (null)

… It never receives the notification.

How would I debug this? Is it possible that my certificate is not configured correctly? If so, would I see an error message somewhere in the process? Or is it possible the Backendless is not sending the notification?

Thanks for laying it out Steven. You broke down the exact process I went through with the exact same results. Hopefully they can let us know what we’re missing.

Michael, Steven,

The sample I’ve attached works for me:

http://support.backendless.com/public/attachments/76c2c8ba90912fc76480c9228baff2cd.png&lt;/img&gt;
and I hope to understand why it doesn’t work for you.

What kind of certificate do you use - sandbox or universal?
If ‘universal’ then you should set:
http://support.backendless.com/public/attachments/59cd144ff69f0f1140cfb2194d1778d3.png&lt;/img&gt;

And also - did you download provisioning profile (*.mobileprovision) and drag-and-drop it to Xcode?

Steven,
I got it working using the template. Don’t forget to set “Capabilities” to enabled push notifications.

Slav - I got the message that the notification was received. However, it’s not in the Notifications tab on my iOS device like I’d expect for a push notification. What’s going on here? What can I do to make that happen? If you want me to open a new topic, I can do that.

Thanks Michael. I do have Capabilities set to enabled push notifications.

Slava: I chose a sandbox certificate. Could that be the problem?

I did download the *.mobileprovision file. I double-clicked it and I can see it under Preferences/Accounts/Apple IDs/Team/View Details.

Maybe I should try to generate a Universal Certficate.

Went ahed and opened a new question for my new problem so it doesn’t get buried in here, Slav.

Hey, Michael!
Could you solve the issue?

Hi Slava,

I ran into the same problem. I’m using your sample and went through the steps exactly as Steven described above, and I have the same result as him. The message is never received.
Is there a way to find out what exactly is going wrong? How could I debug this?

Thanks,
Katia

Yes, please, try our sample project (see in attachment).

TestPushNotify.zip (19.27MB)