Quickstart-ios: "Recipient time zone" based push notifications not working

Created on 15 Dec 2016  路  20Comments  路  Source: firebase/quickstart-ios

I followed these steps:

a. cloned the Messaging example project
b. changed the bundle id to my own (that's already set to a Firebase console app)
c. ran the app on a real device and accepted the permissions request

I then created a couple of notifications similar to this one yesterday:

screen shot 2016-12-15 at 15 44 45

And I didn't receive any of them.

I successfully received "Single device" and "Send Now" push notifications.

Most helpful comment

@jarrodrobins, Yes, I switched to OneSignal.

All 20 comments

Could you confirm that you did not uninstall the app after sending the notification. The scheduled notifications are scheduled locally and if the application is uninstalled the local notification would go with it.

So the data notifications are sent immediately to the existing devices, even if I schedule it to be sent the next week?

So, a new user that installs the app after a push notification is scheduled, will receive it or not?

The message is immediately sent to the device, but not displayed to the user until the scheduled time.

@revolter correct, only users at the time of the scheduling will receive the notification.

@kroikie, but, if the users at the time of the scheduling don't open the app at all, will they receive it?

Yes, once the users are able to receive "now" notifications then they will be able to receive scheduled ones.

But this documentation page states that:

On iOS, FCM stores the message and delivers it only when the app is in the foreground and has established a FCM connection.

That is referring to data messages. Scheduled messages (as all messages from the console) are notification messages sent through APNs.

But doesn't that mean that the users will receive a notification immediately after we set it in the console, and then the scheduled local notification?

Yes that is correct. The device will receive the notification (not displayed) and then a local notification would be scheduled.

How can you receive a notification which is not displayed? Resty from the support told me that "You can create a notification message and a notification + data message only, not data message alone".

The message will be sent with the content_available field set to true, this will make a silent notification. Once received silently it is then scheduled.

Ooh, I see. Is the content_available field supported on iOS 7+?

Yes.

@kroikie, Ran some tests this weekend, and it looks like indeed it's not working well.

I did these steps for the Quickstart app:

  • cloned this project
  • changed the Messaging project's bundle id to my own
  • added my own GoogleServices.plist file to it
  • ran the app on one of my devices
  • accepted the notifications permission request
  • closed the app

I did these steps for my app:

  • ran my own app (that has the same bundle id) on another device
  • accepted the notifications permission request
  • closed the app

So I had 2 apps with the same bundle id, so they'll be treated as the same, one being the sample (with swizzling enabled, of course) and the other one being my code with my own Firebase integration (with swizzling disabled).

I then went to the console and scheduled 3 pushes for Saturday, but none was received.

I opened the apps then backgrounded them and scheduled 9 pushes for Sunday. This time, the Quickstart app received all but the first 2 pushes, and my app received all of them.

I then closed the apps and scheduled 11 pushes for Monday. Up until now, none was received.

The Quickstart app was run on an iOS 10.1.1 iPhone 5S and my app was run on an iOS 10.2 iPhone 6S.

I was not using the latest GoogleServices.info plist file, as it looks like it changed, though "Send now" and "Single device" push notifications worked multiple times.

Is the Background fetch mode needed for this to work? Or only the Remote notifications mode?

I am having the exact same issue and haven't been able to find a solution.

Users of my app are able to receive standard "send now" notifications but anything sent via "recipient time zone" simply never shows up.

Regarding the quote from @kroikie

The device will receive the notification (not displayed) and then a local notification would be scheduled.

Just to clarify - we are not expected to schedule the local notification ourselves, right? Firebase is doing this for us, correct?

Did you ever work out your issues, @revolter ?

@jarrodrobins, Yes, I switched to OneSignal.

I have the same issue in my Unity3D project.

Was this page helpful?
0 / 5 - 0 ratings