Firebase-ios-sdk: Only display firebase in-app messaging in a specific View

Created on 12 Nov 2019  路  3Comments  路  Source: firebase/firebase-ios-sdk

[REQUIRED] Describe the problem

My iOS app is organized as follow:

  • Main menu screen which has many buttons

  • Each button redirects to a specific view/screen

I want to display in-app message in Main menu screen only; but currently it can be shown in both Main screen and other screens.

How can I limit the display of in-app to a specific screen only?

Steps to reproduce:

I did use firebase event to trigger the display of in-app message after main menu screen is opened; but if I open the main menu screen, then quickly open another screen called A, then in-app message is still shown in screen A.

inappmessaging question

All 3 comments

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

@rizafran thanks for the question.

There are a few ways you could accomplish this.

1.) There is a flag called messageDisplaySuppressed that can be set on the InAppMessaging singleton that can be used to prevent in-app messages from appearing. You could, for example, set this flag to false when the main menu screen appears and set it to true when it disappears.

2.) You could programmatically trigger the message using a custom event trigger in the main menu screen. In this case, the message wouldn't show in another screen because you wouldn't trigger in those other screens.

thanks for the rapid support!
I should've read the docs more carefully before asking this question :)

Was this page helpful?
0 / 5 - 0 ratings