Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No support to get UserId/PlayerId #308

Open
douglassimaodev opened this issue Jun 28, 2022 · 6 comments
Open

No support to get UserId/PlayerId #308

douglassimaodev opened this issue Jun 28, 2022 · 6 comments

Comments

@douglassimaodev
Copy link

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;
}));
@jkasten2
Copy link
Member

@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

@douglassimaodev
Copy link
Author

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?

@jkasten2
Copy link
Member

@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?

@douglassimaodev
Copy link
Author

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

@tanaynigam
Copy link
Contributor

@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

@ChoyWingLun
Copy link

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants