Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open counts from push notifications are not counted (IOS) #7707

Closed
chris-o3h opened this issue Oct 9, 2020 · 57 comments
Closed

Open counts from push notifications are not counted (IOS) #7707

chris-o3h opened this issue Oct 9, 2020 · 57 comments

Comments

@chris-o3h
Copy link

[REQUIRED] Please fill in the following fields:

  • Unity editor version: 2019.4.5.f1
  • Firebase Unity SDK version: 6.15.2
  • Source you installed the SDK: Package Manager
  • Problematic Firebase Component: Cloud Messaging
  • Other Firebase Components in use: Auth, Database, Dynamic Linking, Crashalytics, Analytics
  • Additional SDKs you are using: Too many to list, no add mob or any other analytics
  • Platform you are using the Unity editor on: Mac
  • Platform you are targeting: iOS
  • Scripting Runtime: IL2CPP

[REQUIRED] Please describe the issue here:

Open counts for push notifications are usually zero or low. Even when explicitly testing opening a push not
We are currently in an alpha stage with our app and we cannot determine why the open rates are so low. Even in our dev environment the open rates are a total of 48 for the last 90 days even though we've opened many more push notes than this and sent over 12,000 push notifications.

We are unsure of how to make the "open count" work. We have tried adding FIREBASE_ANALYTICS_COLLECTION_ENABLED to the plist as well as setting the notification_open event to a conversion event.

Frankly I'm not sure if this is a bug or simply a detail that is not well documented.

Steps to reproduce:

Simply run your app, receive a push note and open the app. The open will not count on the console's open count. And if it does it is not consistent.

@ciarand
Copy link

ciarand commented Oct 15, 2020

Hey @chris-o3h, thanks for the report! We're looking into this (internal ref b/162390628), but this is definitely not the expected behavior. I've added our iOS expert (hi @chliangGoogle!) who's been investigating this so we can update this thread as we figure out what's going on

@chkuang-g
Copy link

@chliangGoogle

FYI, Firebase Unity SDK 6.15.2 is using Pod "Firebase/Messaging" version "6.24.0"
The latest Firebase Unity SDK 6.16.0 is using Pod "Firebase/Messaging" version "6.32.2"

@charlotteliang
Copy link
Contributor

@chris-o3h Are you using the console "send now", "timezone" or "local time recipient" to send the notifications?

@chris-o3h
Copy link
Author

Thanks @ciarand and @chliangGoogle for looking into this.

For an adhoc test I was using the console with a "send now" push notification. However the majority of the 12K notifications we've sent on dev are programmatically sent via our Java microservices to our Unity IOS client app.

@dan-o3h
Copy link

dan-o3h commented Jan 8, 2021

I did a bit more testing with the following:
Firebase 7.0.2
Unity 2019.4.5f1
Xcode 12.3
iOS 14.1

Here were the results when tapping on a received push notification:

  • App cold start: notification_foreground
  • App from background: notification_open
  • App in foreground : notification_foreground

One would expect the cold start to fire notification_open, but it waits for the app to start up, and because it's then in the foreground, notification_foreground is fired. This basically means we cannot track when the app is opened from a push notification.

@charlotteliang
Copy link
Contributor

@chris-o3h were you able to see notification_open even logged in analytics debug view?

@chkuang-g
Copy link

This is the internal bug to track this
b/162390628

I'll transfer this to firebase-ios-sdk for issue management sake.

@chliangGoogle Could you transfer this back to firebase/quickstart-unity once it is fixed, so that we can schedule release pointing to the fixes in iOS SDK.
If this is a duplicate on firebase-ios-sdk, please transfer this back and reference that Github issue in this thread.

Thanks,
Shawn

@chkuang-g chkuang-g transferred this issue from firebase/quickstart-unity Mar 12, 2021
@google-oss-bot
Copy link

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@google-oss-bot
Copy link

Hey @chris-o3h. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

@khuffie
Copy link

khuffie commented Mar 24, 2021

@chliangGoogle - the google-oss-bot is stating this issue is stale.

Is this still being investigated on your end?

We are seeing the same issue in our iOS app. On Android, our push notification rate is about 27%, on iOS, it's less than 1%. We do see an uptick in users on iOS whenever we send a push notifications, so they ARE being received and opened.

@paulb777
Copy link
Member

Looks like this was marked stale because of the open question above:

@chris-o3h were you able to see notification_open even logged in analytics debug view?

@charlotteliang
Copy link
Contributor

@chris-o3h Can you also let us know if you are using "send now" or "scheduled" message? If you use "scheduled" message, are you using local timezone or specific timezone?

Here's how you can use analytics debug view to see if notificaiton_open is logged: https://firebase.google.com/docs/analytics/debugview

@khuffie
Copy link

khuffie commented Mar 29, 2021

@chliangGoogle - I can share my experience as well

We have used both "send now" and "scheduled" messages. Both messages were in specific timezones.

In our tests, we could not see the notification_open being logged in debugview consistently.

@google-oss-bot
Copy link

Hey @chris-o3h. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

@khuffie
Copy link

khuffie commented Apr 5, 2021

@chliangGoogle this keeps getting marked as stale but there’s indications of an internal ticket. I’ve also provided responses to your questions.

Is this issue prioritized at your end? If we can’t reliably track our push notifications open rate then it becomes impossible to track the success of any of our metrics and we’d have to look at other tools.

@paulb777
Copy link
Member

paulb777 commented Apr 5, 2021

It's automatically marked stale because the original poster did not respond to the questions. I'll remove the needs-info tag so it doesn't get marked stale again.

@charlotteliang
Copy link
Contributor

@khuffie So it seems like the pipeline is functioning cuz you do see event in debug_view, but just not consistently for every message? Can you file a separate customer ticket so we can route analytic backend to help investigate on that.

@dan-o3h
Copy link

dan-o3h commented Apr 21, 2021

FYI the solution we had was to check the args.Message.NotificationOpened flag and send our own custom event e.g. "my_notification_open" containing an "fcm_message_id" param to store the FirebaseMessage.MessageId. We then enabled the FCM analytics for BigQuery and then we could count the number of the custom "my_notification_open" events vs the number of sent events that have the same MessageId.

It works for analytics through BigQuery as the numbers can be compared with FCM data, but it's not useful for building Audience cohorts in the Firebase console for creating campaigns.

FirebaseMessaging.MessageReceived += OnMessageReceived;

private void OnMessageReceived(object sender, MessageReceivedEventArgs args)
{
            if (args.Message.NotificationOpened)
            {
                 // track custom event
                 FirebaseAnalytics.LogEvent("my_notification_open", new Parameter("fcm_message_id", args.Message.MessageId));
            }
}
@charlotteliang
Copy link
Contributor

@khuffie Can you confirm my question at #7707 (comment)?

@khuffie
Copy link

khuffie commented May 7, 2021

@chliangGoogle - We use push notifications deeplink our users to specific screens in the app. Our deep link functionality works 100%, whether the open event is tracked or not.

to I confirmed with our development team that the deep link handling in our app starts with the swift equivalent of that method, so that method is getting triggered reliably.

@google-oss-bot
Copy link

Hey @chris-o3h. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

@khuffie
Copy link

khuffie commented May 14, 2021

@chliangGoogle
we retested after removing antoher push messaging SDK and are still seeing issue. No events are sent from a cold start.

We are using an older version of the SDK ( FIRMessaging 4.6.1). We are planning to update to the latest version.

@charlotteliang
Copy link
Contributor

@khuffie I don't know if you are in the same team with @dan-o3h can you also confirm if you have swizzling on or off?

@khuffie
Copy link

khuffie commented May 14, 2021

@chliangGoogle we're a separate org. Confirmed with our devs, swizzling is on.

@khuffie
Copy link

khuffie commented May 20, 2021

@chliangGoogle we updated to the latest versions of the Firebase SDK and we are still experiencing the same issue. When the app is not in the background, notification_open does not get triggered.

This is becoming a huge issue in our (fairly large) org. As you can imagine, we have no way of understanding the success of push notifications on iOS which is a huge blocker for our marketing and product teams.

Can you please clarify what your team is doing to resolve this issue?

@charlotteliang
Copy link
Contributor

@alexames So for iOS, the app must implement userNotificationCenter(_:didReceive:withCompletionHandler:) for open signal to trigger. I wonder for C++ and Unity, do we have this implementation under the hood by default for developers to be able to log? Currently developers are seeing issues that notification_open is not logged.

@khuffie
Copy link

khuffie commented May 20, 2021

@chliangGoogle I opened a separate ticket here: #8128

@google-oss-bot
Copy link

Hey @chris-o3h. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

@charlotteliang
Copy link
Contributor

We discovered an issue in our logging and pushed a fix. Please watch for next unity release that should have the fix. Let us know if the issue gets resolved.

@filipealva
Copy link

@chliangGoogle Does it affect the regular Firebase SDK (not unity)?

I'm having issues trying log the pushes that are being received. Method swizzling is enabled and didReceiveRemoteNotification is never called

@charlotteliang
Copy link
Contributor

It should be both. The iOS SDK fix is rolling out soon, @filipealva are you using iOS or unity?

@filipealva
Copy link

@chliangGoogle I'm using iOS.

My issue is that the app delegate's callback that should be called when the app receives a remote notification and is in background is not being called. Method swizzling is enabled.

Do you think that this fix you guys are rolling out can have something to do with my issue too?

@charlotteliang
Copy link
Contributor

App delegate's callback not getting triggered does not seem to relate to FCM or this issue.

To receive notification in background, are you talking about this callback?
https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1623013-application

@filipealva
Copy link

@chliangGoogle yes, it's this delegate method.

Are you sure it can't be related to FCM?

Since the Messaging SDK does method swizzling on this method maybe it could be failing to proxy the calls, couldn't?

@charlotteliang
Copy link
Contributor

I think we need to first investigate why the callback itself is not triggered. In any case it's not related to this issue. Please open another issue if you like to check more on FCM side.

@google-oss-bot
Copy link

Hey @chris-o3h. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

@google-oss-bot
Copy link

Since there haven't been any recent updates here, I am going to close this issue.

@chris-o3h if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

@firebase firebase locked and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.