File tree Expand file tree Collapse file tree 4 files changed +15
-6
lines changed Expand file tree Collapse file tree 4 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,12 @@ class _MyAppState extends State<MyApp>
40
40
// NOTE: Replace with your own app ID from https://www.onesignal.com
41
41
OneSignal .shared.initialize ("77e32082-ea27-42e3-a898-c72e141824ef" );
42
42
43
+ // AndroidOnly stat only
44
+ // OneSignal.Notifications.removeNotification(1);
45
+ // OneSignal.Notifications.removeGroupedNotifications("group5");
46
+
47
+ OneSignal .Notifications .clearAll ();
48
+
43
49
OneSignal .User .pushSubscription.addObserver (this );
44
50
OneSignal .Notifications .addPermssionObserver (this );
45
51
@@ -194,10 +200,12 @@ class _MyAppState extends State<MyApp>
194
200
print ("Setting external user ID" );
195
201
if (_externalUserId == null ) return ;
196
202
OneSignal .shared.login (_externalUserId! );
203
+ OneSignal .User .addAlias ("fb_id" , "1341524" );
197
204
}
198
205
199
206
void _handleLogout () {
200
207
OneSignal .shared.logout ();
208
+ OneSignal .User .removeAlias ("fb_id" );
201
209
}
202
210
203
211
oneSignalInAppMessagingTriggerExamples () async {
Original file line number Diff line number Diff line change @@ -58,7 +58,8 @@ + (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
58
58
59
59
// TODO version
60
60
[OneSignal setMSDKType: @" flutter" ];
61
-
61
+ [OneSignal sdkVersion: @" 050000" ];
62
+
62
63
OneSignalPlugin.sharedInstance .channel = [FlutterMethodChannel
63
64
methodChannelWithName: @" OneSignal"
64
65
binaryMessenger: [registrar messenger ]];
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ class OneSignalNotifications {
48
48
/// Removes a grouped notification.
49
49
Future <void > removeGroupedNotifications (String notificationGroup) async {
50
50
if (Platform .isAndroid) {
51
- return await _channel.invokeMethod ("OneSignal#removeGroupedNotification " ,
51
+ return await _channel.invokeMethod ("OneSignal#removeGroupedNotifications " ,
52
52
{'notificationGroup' : notificationGroup});
53
53
}
54
54
}
Original file line number Diff line number Diff line change @@ -33,16 +33,16 @@ class OneSignalUser {
33
33
///
34
34
/// If any alias already exists, it will be overwritten to the new values.
35
35
Future <void > addAliases (Map <String , dynamic > aliases) async {
36
- return await _channel.invokeMethod ("OneSignal#addAlias " , aliases);
36
+ return await _channel.invokeMethod ("OneSignal#addAliases " , aliases);
37
37
}
38
38
39
39
/// Remove an [alias] from the current user.
40
- Future <void > removeAlias (String alias, dynamic id ) async {
41
- return await this .removeAliases ({alias : id} );
40
+ Future <void > removeAlias (String label ) async {
41
+ return await this .removeAliases ([label] );
42
42
}
43
43
44
44
/// Remove [aliases] from the current user.
45
- Future <void > removeAliases (Map <String , dynamic > aliases) async {
45
+ Future <void > removeAliases (List <String > aliases) async {
46
46
return await _channel.invokeMethod ("OneSignal#removeAliases" , aliases);
47
47
}
48
48
You can’t perform that action at this time.
0 commit comments