klaviyo / klaviyo-swift-sdk

Swift SDK for integrating Klaviyo’s push notifications, event tracking, and user profile management into iOS applications.
https://www.klaviyo.com/mobile-push-marketing
MIT License
12 stars 11 forks source link

Push Token shows Null in profile after User Registration. #123

Closed plRohitkios closed 9 months ago

plRohitkios commented 10 months ago

Description

I am calling User Registration event using following SDK method. And then call set push token

klaviyoSdk?.set(profile: Profile(email: email, phoneNumber: number, externalId: externalId)) klaviyoSdk?.set(pushToken: localToken)

if user is not doing any other action we are seeing Push Token as Null as soon as we check the registration event. If user does some activity by triggering other Klaviyo events the PushToken is reflecting. Attaching image for reference. Let me know if I need to do some thing else at code side to resolve it.

Screenshot 2023-12-06 at 12 50 12 PM

Checklist

Expected behavior

As soon as the User Registration gets called and set token method is called push token should get reflected

Actual behavior

No response

Steps to reproduce

I am calling User Registration event using following SDK method.

klaviyoSdk?.set(profile: Profile(email: email, phoneNumber: number, externalId: externalId))

And then call set push token

klaviyoSdk?.set(pushToken: localToken)

The Klaviyo Swift SDK version information

2.2.1

Destination operating system

iOS 16.2

Xcode version information

13

Swift Compiler version information

No response

ndurell commented 10 months ago

IIRC we currently only add the push token to the opened push event. We can definitely look into adding it for all other custom events as well. Just to be sure though you should still see that the token is associated with your profile even though it is not in that event. Also note: we have updated some of the behavior for set profile in 2.3.0, so you shouldn't need to set the token again after setting profile.

plRohitkios commented 10 months ago

Hi @ndurell, Thank you for the response. Also as I was doing some trial and error adding the delay before calling klaviyoSdk?.set(profile: Profile(email: email, phoneNumber: number, externalId: externalId)) we are able to see token in the newly registered profile.

ndurell commented 10 months ago

Just to make sure we aren't confusing things. Are you saying you weren't seeing the token on the profile or in the event. These are actually two different things. Regardless you may want to try 2.3.0 as we fixed a bunch issues around set profile and set token.

plRohitkios commented 9 months ago

@ndurell we were not able to locate token in profile section for any profile. We were checking it for the register Event. Let us try using the latest SDK version 2.3.0. Will update you here. Thank you.

plRohitkios commented 9 months ago

@ndurell the event is now showing token correctly after SDK update. hence closing this ticket.