File tree Expand file tree Collapse file tree 8 files changed +16
-14
lines changed Expand file tree Collapse file tree 8 files changed +16
-14
lines changed Original file line number Diff line number Diff line change 17
17
- name : Setup Flutter
18
18
uses : subosito/flutter-action@v2
19
19
with :
20
- flutter-version : ' 2.10.4 '
20
+ flutter-version : ' 3.3.2 '
21
21
channel : ' stable'
22
22
23
23
- name : Checkout OneSignal-Flutter-SDK
27
27
run : flutter pub get
28
28
29
29
- name : Static Analysis
30
- run : flutter analyze --no-pub --no-fatal-infos
30
+ run : flutter analyze
31
31
32
32
- name : Ensure the Dart code is formatted correctly
33
33
run : flutter format -o none --set-exit-if-changed .
Original file line number Diff line number Diff line change @@ -231,7 +231,7 @@ class _MyAppState extends State<MyApp> {
231
231
// Toggle pausing (displaying or not) of IAMs
232
232
OneSignal .InAppMessages .paused (true );
233
233
var arePaused = await OneSignal .InAppMessages .arePaused ();
234
- print ('Notifications paused ${ arePaused } ' );
234
+ print ('Notifications paused $arePaused ' );
235
235
}
236
236
237
237
oneSignalOutcomeExamples () async {
Original file line number Diff line number Diff line change @@ -23,12 +23,19 @@ class OneSignal {
23
23
/// Note that the iOS and Android native libraries are static,
24
24
/// so if you create multiple instances of OneSignal, they will
25
25
/// mostly share the same state.
26
+ // ignore: non_constant_identifier_names
26
27
static OneSignalDebug Debug = new OneSignalDebug ();
28
+ // ignore: non_constant_identifier_names
27
29
static OneSignalUser User = new OneSignalUser ();
30
+ // ignore: non_constant_identifier_names
28
31
static OneSignalNotifications Notifications = new OneSignalNotifications ();
32
+ // ignore: non_constant_identifier_names
29
33
static OneSignalSession Session = new OneSignalSession ();
34
+ // ignore: non_constant_identifier_names
30
35
static OneSignalLocation Location = new OneSignalLocation ();
36
+ // ignore: non_constant_identifier_names
31
37
static OneSignalInAppMessages InAppMessages = new OneSignalInAppMessages ();
38
+ // ignore: non_constant_identifier_names
32
39
static OneSignalLiveActivities LiveActivities = new OneSignalLiveActivities ();
33
40
34
41
// private channels used to bridge to ObjC/Java
Original file line number Diff line number Diff line change 1
- import 'package:onesignal_flutter/onesignal_flutter.dart' ;
2
1
import 'package:onesignal_flutter/src/utils.dart' ;
3
2
4
3
/// When a click action is defined on an In App Message form the dashboard,
Original file line number Diff line number Diff line change @@ -362,9 +362,7 @@ class OSNotificationWillDisplayEvent extends JSONStringRepresentable {
362
362
}
363
363
364
364
void preventDefault () {
365
- if (notification != null ) {
366
- OneSignal .Notifications .preventDefault (notification.notificationId);
367
- }
365
+ OneSignal .Notifications .preventDefault (notification.notificationId);
368
366
}
369
367
370
368
String jsonRepresentation () {
@@ -383,9 +381,7 @@ class OSNotificationClickEvent extends JSONStringRepresentable {
383
381
}
384
382
385
383
void preventDefault () {
386
- if (notification != null ) {
387
- OneSignal .Notifications .preventDefault (notification.notificationId);
388
- }
384
+ OneSignal .Notifications .preventDefault (notification.notificationId);
389
385
}
390
386
391
387
String jsonRepresentation () {
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ import 'dart:io';
3
3
import 'package:flutter/services.dart' ;
4
4
import 'package:onesignal_flutter/src/defines.dart' ;
5
5
import 'package:onesignal_flutter/src/notification.dart' ;
6
- import 'package:onesignal_flutter/src/permission.dart' ;
7
6
8
7
typedef void OnNotificationPermissionChangeObserver (bool permission);
9
8
Original file line number Diff line number Diff line change @@ -10,13 +10,15 @@ import 'package:flutter_test/flutter_test.dart';
10
10
11
11
class OneSignalMockChannelController {
12
12
MethodChannel _channel = const MethodChannel ('OneSignal' );
13
+ MethodChannel _debugChannel = const MethodChannel ('OneSignal#debug' );
13
14
MethodChannel _tagsChannel = const MethodChannel ('OneSignal#tags' );
14
15
15
16
late OneSignalState state;
16
17
17
18
OneSignalMockChannelController () {
18
19
this ._channel.setMockMethodCallHandler (_handleMethod);
19
20
this ._tagsChannel.setMockMethodCallHandler (_handleMethod);
21
+ this ._debugChannel.setMockMethodCallHandler (_handleMethod);
20
22
}
21
23
22
24
void resetState () {
@@ -117,7 +119,7 @@ class OneSignalState {
117
119
}
118
120
119
121
void setLogLevel (Map <dynamic , dynamic > params) {
120
- int ? level = params['console ' ] as int ? ;
122
+ int ? level = params['logLevel ' ] as int ? ;
121
123
int ? visual = params['visual' ] as int ? ;
122
124
123
125
if (level != null ) this .logLevel = OSLogLevel .values[level];
Original file line number Diff line number Diff line change @@ -7,13 +7,12 @@ void main() {
7
7
8
8
OneSignalMockChannelController channelController =
9
9
OneSignalMockChannelController ();
10
- OneSignal onesignal = OneSignal ();
11
10
12
11
setUp (() {
13
12
channelController.resetState ();
14
13
});
15
14
16
- test ('set set log level' , () {
15
+ test ('set log level' , () {
17
16
OneSignal .Debug .setLogLevel (
18
17
OSLogLevel .info,
19
18
).then (expectAsync1 ((v) {
You can’t perform that action at this time.
0 commit comments