Skip to content

Commit 1c2439d

Browse files
committed
Add user state observer to example project
1 parent 66a156f commit 1c2439d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

example/lib/main.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ class _MyAppState extends State<MyApp> {
5353
print(state.current.jsonRepresentation());
5454
});
5555

56+
OneSignal.User.addObserver((state) {
57+
var userState = state.jsonRepresentation();
58+
print('OneSignal user changed: $userState');
59+
});
60+
5661
OneSignal.Notifications.addPermissionObserver((state) {
5762
print("Has permission " + state.toString());
5863
});

0 commit comments

Comments
 (0)