braze-inc / braze-react-native-sdk

Public repo for the Braze React Native SDK
https://www.braze.com
Other
64 stars 83 forks source link

[Bug]: Content Cards are shown as push notification #197

Closed alzalabany closed 1 year ago

alzalabany commented 1 year ago

Which Platforms?

iOS

Which React Native Version?

0.71.4

Which @braze/react-native-sdk SDK version?

3.0.0

Repro Rate

100%

Steps To Reproduce

Example:

  1. import Braze from "@braze/react-native-sdk".
  2. Braze.changeUser("id")
  3. send test content card

Expected Behavior

automatically show modal with avaliable cards

Actual Incorrect Behavior

it show up as a push notification with text: "Tap to see your content card. it will expire in 5 minutes". when you click on notification nothing happens and i can see in logs it prints:

2023-03-15 13:21:28.164521+0400 amana[1116:261144] [braze] No matching trigger for event.
- event: event(BrazeKit.Events.Event(userId: Optional("CU158856"), sessionId: 4B10E006-2254-4F08-AC83-699CF47EDC47, time: 2023-03-15 09:21:27 +0000, data: BrazeKit.Events.Event.Data.pushClick(campaignId: (campaignId: test, raw: dGVzdF9...mM1MWFh))))
2023-03-15 13:21:38.164325+0400 amana[1116:261312] [braze] [http] request POST sdk.fra-02.braze.eu/api/v3/data:
  - X-Braze-Api-Key: ed9f7e23-f0dd-4fb0-9876-18917138a930
2023-03-15 13:21:38.668565+0400 amana[1116:261312] [braze] [http] response 201 sdk.fra-02.braze.eu/api/v3/data

Verbose Logs

023-03-15 12:48:04.940721+0400 amana[1092:251883] [native] braze.user.email =  amana@amana.app
2023-03-15 12:48:04.941281+0400 amana[1092:251883] [native] braze.user.firstName =  Amana
2023-03-15 12:48:04.941357+0400 amana[1092:251883] [native] braze.user.lastName =  App
2023-03-15 12:48:04.941422+0400 amana[1092:251883] [native] braze.user.country =  Lebanon
2023-03-15 12:48:04.952338+0400 amana[1092:252237] [braze] [http] request POST sdk.fra-02.braze.eu/api/v3/data:
  - X-Braze-Api-Key: ed9f7e23-f0dd-4fb0-9876-18917138a930
2023-03-15 12:48:05.104163+0400 amana[1092:252237] [braze] [http] response 201 sdk.fra-02.braze.eu/api/v3/data
2023-03-15 12:48:06.248256+0400 amana[1092:252219] [braze] [http] request POST sdk.fra-02.braze.eu/api/v3/content_cards/sync:
  - BRAZE-SYNC-RETRY-COUNT: 0
  - X-Braze-Api-Key: ed9f7e23-f0dd-4fb0-9876-18917138a930
  - X-Braze-ContentCardsRequest: true
  - X-Braze-DataRequest: true
2023-03-15 12:48:06.767554+0400 amana[1092:252212] [braze] [http] response 201 sdk.fra-02.braze.eu/api/v3/content_cards/sync
2023-03-15 12:48:24.926568+0400 amana[1092:252216] [braze] Processing push notification:
      "i" : "https://cdn.braze.eu/appboy/communication/assets/image_assets/images/62f4dfcd80da5e19481bca99/original.jpg?1660215245",
2023-03-15 12:48:24.940220+0400 amana[1092:252237] [braze] [http] request POST sdk.fra-02.braze.eu/api/v3/data:
  - X-Braze-Api-Key: ed9f7e23-XXXXXXXXX-XXXXXXXX
  - X-Braze-DataRequest: true
  - X-Braze-TriggersRequest: true
2023-03-15 12:48:24.944441+0400 amana[1092:252216] [braze] Logged event:
2023-03-15 12:48:25.441051+0400 amana[1092:252216] [braze] [http] response 201 sdk.fra-02.braze.eu/api/v3/data
2023-03-15 12:48:25.446947+0400 amana[1092:252320] [braze] No matching trigger for event.
- event: event(BrazeKit.Events.Event(userId: Optional("CU158856"), sessionId: B34BBE5A-4AD0-456E-B401-29BA0F5CA4A2, time: 2023-03-15 08:48:24 +0000, data: BrazeKit.Events.Event.Data.pushClick(campaignId: (campaignId: test, raw: dGVzdF9...zdhYjk3))))
2023-03-15 12:48:35.456377+0400 amana[1092:252237] [braze] [http] request POST sdk.fra-02.braze.eu/api/v3/data:
  - X-Braze-Api-Key: ed9f7e23-f0dd-4fb0XXXXXXXXX-XXXXXXXX
2023-03-15 12:48:36.027771+0400 amana[1092:252216] [braze] [http] response 201 sdk.fra-02.braze.eu/api/v3/data

Additional Information

No response