OneSignal-Xamarin-SDK icon indicating copy to clipboard operation
OneSignal-Xamarin-SDK copied to clipboard

No support to get UserId/PlayerId

Open douglassimaodev opened this issue 2 years ago • 6 comments

I am using the new OneSignalSDK.Xamarin 4.1.0

I cant find it in the documentation, how can I get the userId/PlayerId as we could get in the old version?

I am uxing xamarin forms 5.0.0.2478

OneSignal.Current.IdsAvailable(new Com.OneSignal.Abstractions.IdsAvailableCallback((playerID, pushToken) =>
{
    playerId = playerID;
}));

douglassimaodev avatar Jun 28 '22 00:06 douglassimaodev

@douglassimaodev Thanks for your question. This IdsAvailable has been changed to OneSignal.Default.PushSubscriptionState.userId. See the full API change list below: https://documentation.onesignal.com/docs/xamarin-40-api-reference#push-notifications

jkasten2 avatar Jun 28 '22 18:06 jkasten2

Thanks, that really helps!

I just created an default xamarin forms app and I cant even build it, anything in particular I need to do in order to get it working in the ios app?

Severity Code Description Project File Line Suppression State Error Could not copy "C:...\packages\onesignalsdk.xamarin\4.1.0\build\Xamarin.iOS....\content\OneSignalSDK.Xamarin.iOS.resources\OneSignalExtension.xcframework\ios-arm64_x86_64-maccatalyst\OneSignalExtension.framework\Versions\A\Headers\OneSignalNotificationServiceExtensionHandler.h" to "C:...\source\repos\DemoApp\DemoApp\DemoApp.iOS\bin\iPhone\Debug/OneSignalSDK.Xamarin.iOS.resources/OneSignalExtension.xcframework\ios-arm64_x86_64-maccatalyst\OneSignalExtension.framework\Versions\A\Headers\OneSignalNotificationServiceExtensionHandler.h". Exceeded retry count of 10. Failed. DemoApp.iOS

Would you have by any change a demo app in xamarin forms to show how to properly implement it?

douglassimaodev avatar Jun 28 '22 21:06 douglassimaodev

@douglassimaodev Thanks for reporting the iOS build error with the OneSignal 4.1.0 SDK. Do you also see this on the OneSignal 4.0.0 version?

jkasten2 avatar Jun 28 '22 21:06 jkasten2

I tried and I am getting:

Severity Code Description Project File Line Suppression State Error Failed to codesign 'bin/iPhone/Debug/device-builds/iphone8.1-15.5/OneSignalNotificationServiceExtension.appex///.metallib': /Users//Library/Caches/Xamarin/mtbs/builds/OneSignalNotificationServiceExtension/f79c2708a21acc1a36e28.***/bin/iPhone/Debug/device-builds/iphone8.1-15.5/OneSignalNotificationServiceExtension.appex//**/.metallib: No such file or directory OneSignalNotificationServiceExtension

Severity Code Description Project File Line Suppression State Error Failed to codesign 'bin/iPhone/Debug/device-builds/iphone8.1-15.5/OneSignalNotificationServiceExtension.appex///.dylib': /Users//Library/Caches/Xamarin/mtbs/builds/OneSignalNotificationServiceExtension/f79c2708a21ac***/bin/iPhone/Debug/device-builds/iphone8.1-15.5/OneSignalNotificationServiceExtension.appex//**/*.dylib: No such file or directory OneSignalNotificationServiceExtension

Severity Code Description Project File Line Suppression State Error /usr/bin/codesign exited with code 1 OneSignalNotificationServiceExtension

Xamarin forms 5.0.0.2012

douglassimaodev avatar Jun 28 '22 22:06 douglassimaodev

@douglassimaodev Could you provide us with details regarding which Operating system and Visual Studio version are you using to build the OneSignalSDK.Xamarin version 4.1.0. Also whether you are facing this issue when building on a simulator or a device

tanaynigam avatar Jul 07 '22 17:07 tanaynigam

@douglassimaodev Thanks for your question. This IdsAvailable has been changed to OneSignal.Default.PushSubscriptionState.userId. See the full API change list below: https://documentation.onesignal.com/docs/xamarin-40-api-reference#push-notifications

Hi I have some scenario where OneSignal.Default.PushSubscriptionState.userId returning null, maybe I know why?

ChoyWingLun avatar Nov 25 '22 09:11 ChoyWingLun