Appboy / appboy-ios-sdk

Public repo for the Braze iOS SDK
https://www.braze.com
Other
165 stars 140 forks source link

The message is not showing up, when implementing #320

Closed YourDaddy2000 closed 2 years ago

YourDaddy2000 commented 2 years ago

Report

Describe your environment.

Info Value
Platform Name iOS
Platform Version 14.5
SDK Version 4.4.0
Integration Method Cocoapods
Xcode Version Xcode 13.1
Computer Processor 2,9 GHz Intel Core i7
Repro rate All the time (100%)

What did you do?

Use slideup code from example: https://www.braze.com/docs/developer_guide/platform_integration_guides/ios/in-app_messaging/in-app_message_delivery/#real-time-in-app-message-creation--display

What did you expect to happen?

the slideup message with "YOUR_CUSTOM_SLIDEUP_MESSAGE" message appears and disappears after 2.5 secs.

What happened instead?

The slide up message is not shown

Steps to reproduce

Code Snippet

let customInAppMessage = ABKInAppMessageSlideup.init() customInAppMessage.message = "YOUR_CUSTOM_SLIDEUP_MESSAGE" customInAppMessage.duration = 2.5 customInAppMessage.extras = ["key": "value"] Appboy.sharedInstance()!.inAppMessageController.add(customInAppMessage)

Additional Info

the customInAppMessage is showing up only if in ABKInAppMessageControllerDelegate's 'before(inAppMessageDisplayed: ABKInAppMessage)' method the return type is 'displayInAppMessageNow'. the message is never shown with 'displayInAppMessageLater' and calling 'displayNextInAppMessage()' where needed

hokstuff commented 2 years ago

Hi @YourDaddy2000,

Thanks for filing this issue. The option ABKDisplayInAppMessageLater is designed not to display the in-app message immediately and instead puts it on a stack, as described here. This allows you to control if or when to display the in-app message at a later time. For the purposes of displaying the in-app message immediately (as what you expected to see happen), please return ABKDisplayInAppMessageNow in your before(inAppMessageDisplayed:).

If you have any further integration questions, feel free to reach out to support@braze.com if there is a more in-depth investigation needed.

Thank you!

YourDaddy2000 commented 2 years ago

Hi @hokstuff,

Thanks for your reply.

ABKDisplayInAppMessageLater is designed not to display the in-app message immediately

this is what I am trying to achieve. I need to postpone the appearance of this message until the certain conditions are met. but the problem is that the message does NOT appear when I call Appboy.sharedInstance()!.inAppMessageController.displayNextInAppMessage()

Is it the way it is supposed to be?

Thanks.

hokstuff commented 2 years ago

Hi @YourDaddy2000,

Can you send over your verbose logs to the Braze Support team (support@braze.com)? That way the team can take a closer look in more depth as to what is happening in your app. There can be a few reasons why the IAM isn't displaying, including if the keyboard is currently presented at the time of display.

Also, note that the call Appboy.sharedInstance()!.inAppMessageController.add(customInAppMessage) adds to the in-app message stack and automatically tries to present it immediately after. Calls to displayNextInAppMessage will simply attempt to display if there is a message on the stack.