braze-inc / braze-swift-sdk

https://www.braze.com
Other
48 stars 19 forks source link

[Bug]: IAM messages with buttons don't appear on iOS #99

Closed fegoulart closed 3 months ago

fegoulart commented 6 months ago

Platform

iOS

Platform Version

iOS 16.7

Braze SDK Version

7.4.0

Xcode Version

XCode 15.1.0

Computer Processor

Apple (M1)

Repro Rate

100%

Steps To Reproduce

Create a campaign on Braze dashboard with the following message: Type: Full-screen Layout: Image & Text Enforced Device Orientation: Portrait Add Image Add Header text Add Body text Add 2 buttons with redirect to Web URL Check Open Web URL Inside the App Message Close: Wait for User to Dismiss

Expected Behavior

The view appears over the current app screen

Actual Incorrect Behavior

The view DOES NOT appear over the current app screen

Verbose Logs

023-12-20 18:33:56.260470-0300 XXXXXXXXXX[12898:2328509] [braze] [http] response 201 [sdk.iad-05.braze.com/api/v3/data](http://sdk.iad-05.braze.com/api/v3/data)
- Headers:
 - Accept-Ranges: bytes
 - Access-Control-Allow-Origin: *
 - Cache-Control: max-age=0, private, must-revalidate
 - Content-Encoding: gzip
 - Content-Type: application/json
 - Date: Wed, 20 Dec 2023 21:33:55 GMT
 - Etag: W/"6cfcc10ccd722cf2e7154f0f377a27bf"
 - Strict-Transport-Security: max-age=31536000; includeSubDomains
 - Vary: Origin,Accept-Encoding
 - Via: 1.1 varnish
 - x-cache: MISS
 - x-cache-hits: 0
 - x-request-id: d7afa4cd-76da-4727-90a4-69baab8e7921
 - x-runtime: 0.160439
 - x-served-by: cache-gru-sbsp2090072-GRU
- Body:
{
 "config" : {
  "attributes_blacklist" : [
   "account_balance_current_membership_level_name",
   "current_sign_in_at",
   "sms_subscription"
  ],
  "content_cards" : {
   "enabled" : 1
  },
  "events_blacklist" : [
   "iap_trigger"
  ],
  "geofences" : {
   "enabled" : 0,

   "min_time_since_last_report" : 0,
   "min_time_since_last_request" : 86400,
   "should_request_authorization" : 0
  },
  "messaging_session_timeout" : 21600,
  "purchases_blacklist" : [

  ],
  "test_user" : {
   "device_logging_enabled" : 0
  },
  "time" : 1700610252
 },
 "feed" : [

 ],
 "triggers" : [
  {
   "data" : {
    "bg_color" : 4294243575,
    "btns" : [
     {
      "bg_color" : 4279990479,
      "border_color" : 4279990479,
      "click_action" : "URI",
      "id" : 0,
      "text" : "WEBLINK",
      "text_color" : 4294967295,
      "uri" : "https://www.cnn.com",
      "use_webview" : 1
     }
    ],
    "click_action" : "URI",
    "close_btn_color" : 4291085508,
    "frame_color" : 3207803699,
    "header" : "TESTING Deeplinking",
    "header_text_color" : 4280624421,
    "image_style" : "TOP",
    "image_url" : "https://braze-images.com/appboy/communication/marketing/slide_up/slide_up_message_parameters/images/65835b5f6fa172004deedc95/4d767b9edd3926e5b04f75d68466c30cdad7d86f/original.png?1703107427",
    "message" : "Another test",
    "message_close" : "SWIPE",
    "orientation" : "PORTRAIT",
    "text_align_header" : "CENTER",
    "text_align_message" : "CENTER",
    "text_color" : 4280624421,
    "trigger_id" : "VERYLARGEBASE64STRING==",
    "type" : "FULL"
   },
   "delay" : 0,
   "end_time" : null,
   "id" : "HEXID",
   "only_ipads" : 1,
   "only_iphones" : 1,
   "priority" : 2000004000,
   "re_eligibility" : 60,
   "start_time" : 1703085300,
   "trigger_condition" : [
    {
     "app_ids" : [
      "HEXAPPID"
     ],
     "type" : "open"
    }
   ],
   "type" : "inapp"
  }
 ]
}

Additional Information

It is working ok on Android. IAMs without buttons works ok. Push notifications are well delivered. App uses Storyboard and UIKit API.

The following libraries are added to the main target:

BrazeUI BrazeLocation BrazeKit

jerielng commented 5 months ago

Hey @fegoulart, does this bug only appear when you have two buttons attached to an IAM or having any number of buttons?

In the verbose logs you attached, there seems to be only one IAM campaign under the triggers array. Is that the IAM you are expecting to appear, or is the IAM payload not included in that triggers array?

Additionally, are you able to send some additional verbose logs that may include the trigger of the IAM? In a typical happy path, there should be a log message starting with the phrase: In-app message ready for display: - this usually indicates that the IAM was successfully triggered and is being sent to the UI layer. If you're able to provide additional verbose logs, we should be able to check where in the flow the IAM could be getting dropped.

Would you be willing to share the above details in addition to your campaign with our support team at support@braze.com so our internal teams can take a closer look at where the issue could be occurring? Thanks!

hokstuff commented 3 months ago

I am closing out this issue due to possible staleness, and since it requires more information (steps to repro, verbose logs of this behavior, more context around the particular integration). If you are still running into this issue, feel free to contact support@braze.com with the requested information above. Thanks!