Firebase Cloud Messaging Notifications for iOS not showing opened and analytics - ios

I'am using FCM to send notifications to iOS apps. The notifications are received on the device well, but I can not get the "Opened" or "Conversion " rate in the Notification console GUI. It always shows "0 opened" and "0 Conversion" for almost 200 0000 notifications sent.
I double checked all the implementation but I can't get it working.
I have FirebaseAppDelegateProxyEnabled set to YES in plist. I implemented all the methods listed on Firebase guides and docs.
I don't have any notification related events showing in the Firebase analytics pane either.

To enable Open count metric in Cloud Messaging > Reports, you need to mark notification_open event as conversion in Analytics > Events:
That's the event automatically generated by Firebase but not enabled by default.

It looks like you need to do some additional setup.
Conversion events
When composing a notification, it is important to think ahead and define which metric to use to assess its effectiveness. A Conversion event is an event or user action that you want to track to further measure and evaluate.
A built-in Notifications funnel analysis automatically reports Notification sent and Notification opened events. You can provide an optional conversion event that you want to analyze with the Notifications funnel analysis.
An Analytics User Property firebase_last_notification is automatically created when you send a notification from the Notifications console the first time. This identifies the most recent notification opened by the user, allowing proper notification attribution of the conversion events.
See Conversion Events to learn more conversion events and steps to take to enable conversion.
Prerequisite: Make sure your app has integrated the Firebase Cloud Messaging SDK, which enables automatic reporting of these notification-related events for the funnel analysis.
Following the link to learn more about 'Conversion Events' you'll read:
Enable events as conversions
Conversions are your most important events. By designating an event as a conversion, you facilitate attribution reporting and postback capacity on that event. Additionally, conversion events are uploaded immediately by the SDK in order to make them actionable more quickly. You may add up to 10 events as conversions.
To designate an event as a conversion:
In Firebase, navigate to your app. In Analytics, click Events, then click Network Settings. In the row for the event, click the selector menu action menu (far right of the row), then click Enable conversion.
Once an event has been enabled as a conversion, it is available in ATTRIBUTION → CONVERSION EVENTS. Attribution reporting begins for that event at the time you enable it as a conversion.
To see AdWords-attributed Conversion Events in your attribution reports, import the Firebase Conversion Event to AdWords. Once you have linked your project to AdWords, then those conversion events will also be available in AdWords. You can import them under Tools → Conversions → Firebase.
Note: The VALUE event parameter supplied with conversion events must be a number, and it must be accompanied by a currency code.

Related

How to auto fill OTP textfield on OTP code received from firebase in iOS, Swift? (WITHOUT TAPPING)

I want to know a callback function that is automatically called and fill the OTP text field (after I receive the OTP code from firebase).
I have already tried:
textfield.contentType = onetimecode.
But this is not what I am looking for, this just gives the otp code fetched from sms as a autocomplete.
I am actually looking for a callback function that is auto fired after I receive OTP code on my phone.
I think picture makes it clear, I want to fill the textfield without tapping (keyboard placeholder thingy) the received OTP code.
By design, iOS apps have no access to incoming SMS messages. There are many discussions out there on a similar topic.
Link 1
Link 2
Link 3
Link 4
The main reason for the restriction is privacy. There is no documented public API to receive a callback when SMS is received. If you try to hack iOS and listen for private notifications then might be your app will be rejected by the App Review team.
While doing research on this topic I found something interesting, you can create an extension that can receive incoming SMS and call events for the purpose of SPAM filtering. This type of extension is called the SMS and Call reporting extension in Apple's ecosystem. While looking at the documentation of this extension, at first glance I thought we can achieve the asked behavior if we can notify our host app about the incoming messages. But while scrolling to the end of the document I found that by design this extension has some additional restrictions:
The extension cannot share data with the host app.
The extension can't access the network directly.
The extension receives the event only if the sender's number is not on the contact list
Anyways it's all about docs, I have not tried anything on the extension. What you can do is try to create an extension and see for other possible solutions.
Example:
1 bad solution in my mind is your extension call your server with the SMS content and then your server forward the SMS content in a silent push notification payload. When your app received the silent notification it serves the purpose of prefilling the field. But again this is not the intended purpose of the extension.
In my opinion, the best is what you have already achieved i.e. setting the text field's content type.

Beginner Firebase User FCM Set-Up Questions

FOR iOS
Notifications
Cannot see an option for in app pop up messsages - is it only push/re-engagement message types?
Can the notifcations be automated not just scheduled one by one? Can this be done programatically? I.e. Something left in basket so send automatic push
Can the notifications be triggered based on in app user behaviour not just audience or property and can they have a time lag e.g. 3 days after trigger? I.e. User clicked on X promotion and hasn't returned in 2 days
Active Users 1, 7, 30 day
Accuracy of data - how reliable is the Firebase Active user data - what is the definition of actives reported?
Viewing new vs returning? Is this possible? I cannot find a view of this in the dashboard?
User Properties
When you add the code for the setUserProperty() once is is registered how does Firebase start to gather than data on this user property value?
Cannot see an option for in app pop up messsages - is it only
push/re-engagement message types?
FCM is for Notifications and data messages. At this time, if you want messages to appear in the app, you would use a data payload and handle the appearance of a pop-up within your code. See About FCM Messages for details on Notifications vs data messages.
Can the notifcations be automated not just scheduled one by one? Can
this be done programatically? I.e. Something left in basket so send
automatic push
From the console, you can schedule notifications. If you want to automate based on events, I suggest you use a combination of Cloud Functions for Firebase and the Admin SDK. Store the FCM tokens in the database for sending.
Can the notifications be triggered based on in app user behaviour not
just audience or property and can they have a time lag e.g. 3 days
after trigger? I.e. User clicked on X promotion and hasn't returned in
2 days
As for a delay, that would be something you'd have to handle in your own server.
Accuracy of data - how reliable is the Firebase Active user data -
what is the definition of actives reported?
According to the documentation, "An active user has engaged with an app in the device foreground, and has logged a user_engagement event."
Viewing new vs returning? Is this possible? I cannot find a view of
this in the dashboard?
No, this is not possible. You can see the first_open event and extrapolate from that.
When you add the code for the setUserProperty() once is is registered
how does Firebase start to gather than data on this user property
value?
According to the documentation, "User properties are effectively sticky event parameters that are automatically logged when you call logEvent."

PlotProjects - using dwelling notifications on iOS

I'm using Plot Projects service to send geofencing notifications to users of iOS and Android application.
I want to use "dwelling" event to trigger specific notifications when user remains at one specific geofence for some extended time. The documentation states that dwelling event can be used on iOS, but has certain specifics:
Please note that due to restrictions in iOS the notification filter for dwelling notifications is called when the user enters the geofence or beacon region and that the returned notifications are only shown when the user remains in the region for the specified amount of time.
By my understanding, this would mean that the Notification filter gets triggered as soon as user enters the geofence, but the notification, if properly filtered, will be displayed after user dwells there. Filtering logic in my case is done on server-side - iOS app sends notification info to server, and then appropriate logic is applied to decide whether to show notification or not.
So, server-side logic for checking whether to show notification or not would be triggered at the time user trips geofence, but the notification would be shown to the user once he dwells there for some time. In my specific case, in order to properly decide whether to show the notification or not, I'd need the check to be done at the time the user really dwells, and not on entering. My understanding is that this cannot be done on iOS (unlike Android).
Am I right to assume this? If not, what would be the way to achieve a dwell-time filtering check, as opposed to enter-time filtering check?
You're correct about the moment when the Notification Filter will trigger on iOS. This is done because of platform limitations. The filter will be called directly when you enter the geofence. When you want filter out messages, that is indeed the time to do so. There is no way to filter at the time of the end of the dwelling period.
This, as mentioned, differs from the behaviour on Android. There it will be called at the end of the dwelling period.

iOS: Retaining connectivity with band

I have 2 apps on the app store with Tiles on the MS Band- (Band Time Tracker and Band List). Both of these suffer from the same issue: over time the connection to the band is lost, events generated in the Band do not trigger code execution on the app.
What types of mitigating strategies can I use to ensure that events always trigger code execution on the phone?
Right now the only thing I have included is haptic feedback to notify the user that the event was accepted.

Capturing iBeacon messages for later use

have a quick question on iBeacons.
Is there a way the user can capture messages they receive when they
are in a particular range to a beacon? Lets say an iBeacon app is being used
in a retail store, the user walks close to a particular beacon and
gets a message prompt and likes it but when he walks away it goes away
and another message appears. Is there a way for the user to capture
which messages they like and look at it later on even when they are
not in the store r within range to a beacon?
Thank you very much
The iBeacon itself doesn't send any messages to the end user. It just makes a three-part numeric identifier available to the app when the iBeacon is visible through the Monitoring or Ranging APIs. Any messaging directly displayed to the user (through a text field or a notification or whatever) always originates from the app itself, in the use case you describe triggered by the iBeacon being detected.
Because the messages always originate from the app and not the iBeacon, you can simply program the app to save off any messaging for later viewing by the end user.
What you want to achieve doesn't seem to be directly related to ibeacons.
It's more about how you will design your app and features. Surely you can save any kind of messages/notifications for posterior use/visualisation. For example you can store them on a server database or locally using iOS user-defaults of your app.
The same thing happens when you receive SMS or email. An app stores them so you can see later, including the time you received and who sent you.

Resources