I am integrating Klaviyo Swift SDK in out React Native Project which has Objective-C for iOS.
To integrate Swift sdk, I have written a package and through that I am setting push token to Klaviyo SDK.
But the resulting APN token is bad (this message I have received from Klaviyo push notification campaign).
I am using PushNotificationIOS to get device token in Javascript and I use this to send to package.
My token is:
let tokenString = "80263c753804d9356a12e47d3e3b64145bba8bf4b1d330cbf7d38dc4f60dc7c811f505086fc8b43b1cabc583724cd11ce98edfdf6cf8db44045ff092d232c35886a058710b3ae73bddda920de153a58a"
I have converted it to Data
as Klaviyo SDK accepts in Data
so I am doing:
Data(tokenString.utf8)
and internally Klaviyo Swift SDK does:
tokenData.map { String(format: "%02.2hhx", $0) }.joined()
and the resulting token is:
38303236336337353338303464393335366131326534376433653362363431343562626138626634623164333330636266376433386463346636306463376338313166353035303836666338623433623163616263353833373234636431316365393865646664663663663864623434303435666630393264323332633335383836613035383731306233616537336264646461393230646531353361353861
This result should match with tokenString.
Need help on this.