question

behnam@ordibeheshtstudio.com avatar image
behnam@ordibeheshtstudio.com asked

What is device token in RegisterForIOSPushNotification

Hi,

I set up android push notification in unity by setting the FCM push token to the playFab client SDK.
The same way doesn't work for iOS in the RegisterForIOSPushNotification function.
The error code is 1000, "Invalid parameter: Token Reason: iOS device tokens must be no more than 400 hexadecimal characters".

Could you help me with how can I set up this?

unity3dPush Notifications
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Seth Du avatar image Seth Du ♦ commented ·

Have you checked the documentation on Push Notification for iOS - PlayFab | Microsoft Docs? May I know which platform/engine you are using to implement the project?

1 Like 1 ·

1 Answer

·
behnam@ordibeheshtstudio.com avatar image
behnam@ordibeheshtstudio.com answered

Oh, you arre right i didn't read this doc completly.
for anyone looking for answer follow these lines:

byte[] token = UnityEngine.iOS.NotificationServices.deviceToken;

request.DeviceToken = System.BitConverter.ToString(token).Replace("-", "").ToLower();

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.