braze-inc / braze-react-native-sdk

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

[Bug]: Could not connect to the server Braze #246

Closed rajneeshraghav closed 9 months ago

rajneeshraghav commented 9 months ago

Which Platforms?

iOS

Which React Native Version?

0.72.4

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

8.0.3

Repro Rate

100%

Steps To Reproduce

Upgrade to React Native 0.72.4 from React Native 0.65.1, migrate to Braze SDK from Appboy SDK

Expected Behavior

User should get notifications on devices if device token and is registered and user is registered

Actual Incorrect Behavior

user is not getting PN on ios

Verbose Logs

Current user is already identified as "*********************".
- location: BrazeKit/BrazeApi+ObjC.swift:241
- function: changeUser(userId:sdkAuthSignature:fileID:line:)
- parameter: userId

The value is not supported.
- value: ""
- type: Swift.String
- location: BrazeKit/ConfigurationExt.swift:9
- function: errors
- parameter: api.endpoint

HTTP URL error:
- code: -1004
- description: "Could not connect to the server."
- url: [POST] https:///api/v3/data
- headers:
  - Content-Type: application/json
  - X-Braze-Api-Key: ***********************
  - X-Braze-DataRequest: true
  - X-Braze-FeedRequest: true
  - X-Braze-Last-Req-Ms-Ago: 2614517
  - X-Braze-Req-Attempt: 41
  - X-Braze-TriggersRequest: true

Additional Information

No response

jerielng commented 9 months ago

Hi @rajneeshraghav, it looks like the SDK is not fully initialized since an empty string is being passed into the endpoint field. Could you verify that you have initialized your Braze instance according to the setup docs? Thanks!

rajneeshraghav commented 9 months ago

thanks @jerielng , it is working