OneSignal / OneSignal-Unity-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your Unity app with OneSignal. https://onesignal.com
Other
218 stars 60 forks source link

Add getters and watchers for oneSignalId and externalId #690

Closed jinliu9508 closed 3 months ago

jinliu9508 commented 4 months ago

Description

One Line Summary

Add getters and observer for onesignalId and externalId.

Details

Motivation

Exposing the onesignal ID and external ID with getters. Also grant developers the ability to add observers that can be called when there is a change in user state.

Scope

UserState contains onesignalId and externalId (both can be empty strings if not available or not set).

Testing

Unit testing

No unit testing at this time

Manual testing

I have added two testing buttons in the test scene for getting onesignalId and externalId. I have also add observer to test the callback when the ids are changed.

Unity version: 2022.3.10f1 For Android: Emulator Pixel 3a api34 For ios: iPhone15 Simulator

Affected code checklist

Checklist

Overview

Testing

Final pass


This change is Reviewable

jinliu9508 commented 3 months ago

Just had some nits, looks good!

Could you also update the Manual testing section in your PR to include what devices and version of Unity you tested on? I think it would be helpful to have it documented

WIP: I will test the PR on devices later

@shepherd-l Thanks for the review! I have made changes addressing all the concerns. Please have a look again.