braze-inc / braze-swift-sdk

Braze SDK for the Apple ecosystem, including: iOS, macOS, iPadOS, visionOS, tvOS
https://www.braze.com
Other
52 stars 19 forks source link

[Bug]: Campaign not triggered by custom event #43

Closed catach closed 1 year ago

catach commented 1 year ago

Platform

iOS

Platform Version

16.2

Braze SDK Version

5.10.1

Xcode Version

14.2

Computer Processor

Apple (M1)

Repro Rate

100%

Steps To Reproduce

  1. Call AppDelegate.braze?.logCustomEvent(name: "MobileEditProfile", properties: nil)
  2. Get [braze] No matching trigger for event.

There is a campaign waiting for the even as a trigger. IT works with Dev keys, but not on Prod

Expected Behavior

Receive the campaign in-app message

Actual Incorrect Behavior

Nothing happens

Verbose Logs

023-02-15 13:52:35.913194-0500 StrideDrive[20226:168114] [braze] Logged event:
- userId: x
- sessionId: x
- time: 2023-02-15 18:52:35 +0000
- data: custom(name: "MobileEditProfile", properties: nil)
2023-02-15 13:52:35.914167-0500 StrideDrive[20226:168114] [braze] No matching trigger for event.
- event: event(BrazeKit.Events.Event(userId: Optional("x"), sessionId: , data: BrazeKit.Events.Event.Data.custom(name: "MobileEditProfile", properties: nil)))
2023-02-15 13:52:42.656277-0500 StrideDrive[20226:168462] [braze] [http] request POST sdk.iad-03.braze.com/api/v3/data:
- Headers:
  - Content-Type: application/json
  - X-Braze-Api-Key: 
- Body:
{
  "api_key" : "",
  "app_version" : "23.2.1",
  "app_version_code" : "23.2.1.0",
  "device_id" : ,
  "events" : [
    {
      "data" : {
        "n" : "MobileEditProfile"
      },
      "name" : "ce",
      "session_id" : ,
      "time" : 1676487155.9089999,
      "user_id" : 
    }
  ],
  "sdk_version" : "5.9.1",
  "time" : 1676487162.6545081
}
2023-02-15 13:52:42.744224-0500 StrideDrive[20226:168378] [braze] [http] response 201 sdk.iad-03.braze.com/api/v3/data
- Headers:
  - Accept-Ranges: bytes
  - Cache-Control: max-age=0, private, must-revalidate
  - Content-Encoding: gzip
  - Content-Type: application/json
  - Date: Wed, 15 Feb 2023 18:52:42 GMT
  - Etag: W/"44136fa355b3678a1146ad16f7e8649e"
  - Server: nginx
  - 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: 
  - x-runtime: 0.024821
  - x-served-by: cache-atl18420-ATL
  - x-timer: S1676487163.713566,VS0,VE40
- Body:
{

}

Additional Information

It works using AppBoySDK. The log is from 5.9.0, but I tested it on 5.10.1, and it doesn't work.

hokstuff commented 1 year ago

Hi @catach,

Can you contact support@braze.com around this issue? Depending on what you mean by works with Dev keys, but not on Prod it is possible that this behavior is as-expected based on how your campaign is set up on the Braze Dashboard, and our Support team can better assist you with that.

In your response, can you add information including:

Thanks!

catach commented 1 year ago

Ok, thanks. Yes, it works with AppBoy SDK (dev and prod APN/config) but not BrazeSDK. I'm already in contact with support.