Skip to content

Commit 7912d94

Browse files
committed
Review comments
1 parent 1efca12 commit 7912d94

File tree

8 files changed

+67
-53
lines changed

8 files changed

+67
-53
lines changed

android/src/main/java/com/onesignal/flutter/OneSignalPlugin.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ private void loginWithJWT(MethodCall call, Result result) {
154154
OneSignal.login((String) call.argument("externalId"), (String) call.argument("jwt"));
155155
replySuccess(result, null);
156156
}
157+
157158
private void logout(MethodCall call, Result result) {
158159
OneSignal.logout();
159160
replySuccess(result, null);

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 42 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@
220220
9705A1C41CF9048500538489 /* Embed Frameworks */,
221221
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
222222
CAB34EA020F96F460024CA6B /* Embed App Extensions */,
223-
7D19491000A09E5367EAA6BE /* [CP] Embed Pods Frameworks */,
223+
5726744B564FC3637D8684A2 /* [CP] Embed Pods Frameworks */,
224224
);
225225
buildRules = (
226226
);
@@ -364,29 +364,7 @@
364364
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
365365
showEnvVarsInLog = 0;
366366
};
367-
7C664CCDDCAE18A4FAB2821F /* [CP] Check Pods Manifest.lock */ = {
368-
isa = PBXShellScriptBuildPhase;
369-
buildActionMask = 2147483647;
370-
files = (
371-
);
372-
inputFileListPaths = (
373-
);
374-
inputPaths = (
375-
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
376-
"${PODS_ROOT}/Manifest.lock",
377-
);
378-
name = "[CP] Check Pods Manifest.lock";
379-
outputFileListPaths = (
380-
);
381-
outputPaths = (
382-
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
383-
);
384-
runOnlyForDeploymentPostprocessing = 0;
385-
shellPath = /bin/sh;
386-
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
387-
showEnvVarsInLog = 0;
388-
};
389-
7D19491000A09E5367EAA6BE /* [CP] Embed Pods Frameworks */ = {
367+
5726744B564FC3637D8684A2 /* [CP] Embed Pods Frameworks */ = {
390368
isa = PBXShellScriptBuildPhase;
391369
buildActionMask = 2147483647;
392370
files = (
@@ -416,6 +394,28 @@
416394
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
417395
showEnvVarsInLog = 0;
418396
};
397+
7C664CCDDCAE18A4FAB2821F /* [CP] Check Pods Manifest.lock */ = {
398+
isa = PBXShellScriptBuildPhase;
399+
buildActionMask = 2147483647;
400+
files = (
401+
);
402+
inputFileListPaths = (
403+
);
404+
inputPaths = (
405+
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
406+
"${PODS_ROOT}/Manifest.lock",
407+
);
408+
name = "[CP] Check Pods Manifest.lock";
409+
outputFileListPaths = (
410+
);
411+
outputPaths = (
412+
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
413+
);
414+
runOnlyForDeploymentPostprocessing = 0;
415+
shellPath = /bin/sh;
416+
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
417+
showEnvVarsInLog = 0;
418+
};
419419
9740EEB61CF901F6004384FC /* Run Script */ = {
420420
isa = PBXShellScriptBuildPhase;
421421
alwaysOutOfDate = 1;
@@ -597,7 +597,10 @@
597597
"$(PROJECT_DIR)/Flutter",
598598
);
599599
INFOPLIST_FILE = Runner/Info.plist;
600-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
600+
LD_RUNPATH_SEARCH_PATHS = (
601+
"$(inherited)",
602+
"@executable_path/Frameworks",
603+
);
601604
LIBRARY_SEARCH_PATHS = (
602605
"$(inherited)",
603606
"$(PROJECT_DIR)/Flutter",
@@ -623,7 +626,10 @@
623626
"$(PROJECT_DIR)/Flutter",
624627
);
625628
INFOPLIST_FILE = Runner/Info.plist;
626-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
629+
LD_RUNPATH_SEARCH_PATHS = (
630+
"$(inherited)",
631+
"@executable_path/Frameworks",
632+
);
627633
LIBRARY_SEARCH_PATHS = (
628634
"$(inherited)",
629635
"$(PROJECT_DIR)/Flutter",
@@ -653,7 +659,11 @@
653659
GCC_C_LANGUAGE_STANDARD = gnu11;
654660
INFOPLIST_FILE = OneSignalNotificationServiceExtension/Info.plist;
655661
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
656-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
662+
LD_RUNPATH_SEARCH_PATHS = (
663+
"$(inherited)",
664+
"@executable_path/Frameworks",
665+
"@executable_path/../../Frameworks",
666+
);
657667
PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.example.OneSignalNotificationServiceExtensionA;
658668
PRODUCT_NAME = "$(TARGET_NAME)";
659669
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -682,7 +692,11 @@
682692
GCC_C_LANGUAGE_STANDARD = gnu11;
683693
INFOPLIST_FILE = OneSignalNotificationServiceExtension/Info.plist;
684694
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
685-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
695+
LD_RUNPATH_SEARCH_PATHS = (
696+
"$(inherited)",
697+
"@executable_path/Frameworks",
698+
"@executable_path/../../Frameworks",
699+
);
686700
PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.example.OneSignalNotificationServiceExtensionA;
687701
PRODUCT_NAME = "$(TARGET_NAME)";
688702
PROVISIONING_PROFILE_SPECIFIER = "";

ios/Classes/OSFlutterNotifications.m

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,6 @@ - (void)lifecycleInit:(FlutterMethodCall *)call withResult:(FlutterResult)result
104104
result(nil);
105105
}
106106

107-
108-
109107
- (void)onOSPermissionChanged:(OSPermissionState*)state {
110108
[self.channel invokeMethod:@"OneSignal#OSPermissionChanged" arguments:state.jsonRepresentation];
111109
}

ios/Classes/OSFlutterUser.m

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,60 +46,66 @@ + (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
4646

4747
- (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
4848
if ([@"OneSignal#setLanguage" isEqualToString:call.method])
49-
[self setLanguage:call];
49+
[self setLanguage:call withResult:result];
5050
else if ([@"OneSignal#addAliases" isEqualToString:call.method])
51-
[self addAliases:call];
51+
[self addAliases:call withResult:result];
5252
else if ([@"OneSignal#removeAliases" isEqualToString:call.method])
53-
[self removeAliases:call];
53+
[self removeAliases:call withResult:result];
5454
else if ([@"OneSignal#addTags" isEqualToString:call.method])
55-
[self addTags:call];
55+
[self addTags:call withResult:result];
5656
else if ([@"OneSignal#removeTags" isEqualToString:call.method])
57-
[self removeTags:call];
57+
[self removeTags:call withResult:result];
5858
else if ([@"OneSignal#addEmail" isEqualToString:call.method])
59-
[self addEmail:call];
59+
[self addEmail:call withResult:result];
6060
else if ([@"OneSignal#removeEmail" isEqualToString:call.method])
6161
[self removeEmail:call withResult:result];
6262
else if ([@"OneSignal#addSms" isEqualToString:call.method])
63-
[self addSms:call];
63+
[self addSms:call withResult:result];
6464
else if ([@"OneSignal#removeSms" isEqualToString:call.method])
6565
[self removeSms:call withResult:result];
6666

6767
else
6868
result(FlutterMethodNotImplemented);
6969
}
7070

71-
- (void)setLanguage:(FlutterMethodCall *)call {
71+
- (void)setLanguage:(FlutterMethodCall *)call withResult:(FlutterResult)result {
7272
id language = call.arguments[@"language"];
7373
if (language == [NSNull null]) {
7474
language = nil;
7575
}
7676

7777
[OneSignal.User setLanguage:language];
78+
result(nil);
7879
}
7980

80-
- (void)addAliases:(FlutterMethodCall *)call {
81+
- (void)addAliases:(FlutterMethodCall *)call withResult:(FlutterResult)result {
8182
NSDictionary *aliases = call.arguments;
8283
[OneSignal.User addAliases:aliases];
84+
result(nil);
8385
}
8486

85-
- (void)removeAliases:(FlutterMethodCall *)call {
87+
- (void)removeAliases:(FlutterMethodCall *)call withResult:(FlutterResult)result {
8688
NSDictionary *aliases = call.arguments;
8789
[OneSignal.User removeAliases:aliases];
90+
result(nil);
8891
}
8992

90-
- (void)addTags:(FlutterMethodCall *)call {
93+
- (void)addTags:(FlutterMethodCall *)call withResult:(FlutterResult)result {
9194
NSDictionary *tags = call.arguments;
9295
[OneSignal.User addTags:tags];
96+
result(nil);
9397
}
9498

95-
- (void)removeTags:(FlutterMethodCall *)call {
99+
- (void)removeTags:(FlutterMethodCall *)call withResult:(FlutterResult)result {
96100
NSDictionary *tags = call.arguments;
97101
[OneSignal.User removeTags:tags];
102+
result(nil);
98103
}
99104

100-
- (void)addEmail:(FlutterMethodCall *)call {
105+
- (void)addEmail:(FlutterMethodCall *)call withResult:(FlutterResult)result {
101106
NSString *email = call.arguments;
102107
[OneSignal.User addEmail:email];
108+
result(nil);
103109
}
104110

105111
- (void)removeEmail:(FlutterMethodCall *)call withResult:(FlutterResult)result {
@@ -108,9 +114,10 @@ - (void)removeEmail:(FlutterMethodCall *)call withResult:(FlutterResult)result {
108114
result(nil);
109115
}
110116

111-
- (void)addSms:(FlutterMethodCall *)call {
117+
- (void)addSms:(FlutterMethodCall *)call withResult:(FlutterResult)result {
112118
NSString *smsNumber = call.arguments;
113119
[OneSignal.User addSms:smsNumber];
120+
result(nil);
114121
}
115122

116123
- (void)removeSms:(FlutterMethodCall *)call withResult:(FlutterResult)result {

ios/Classes/OneSignalPlugin.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
100100
#pragma mark Init
101101

102102
- (void)initialize:(FlutterMethodCall *)call withResult:(FlutterResult)result{
103-
104103
[OneSignal initialize:call.arguments[@"appId"] withLaunchOptions:nil];
105104
result(nil);
106105
}

lib/onesignal_flutter.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class OneSignal {
4545
/// Login to OneSignal under the user identified by the [externalId] provided.
4646
///
4747
/// The act of logging a user into the OneSignal SDK will switch the
48-
/// [user] context to that specific user.
48+
/// user context to that specific user.
4949
Future<void> login(String externalId) async {
5050
return await _channel
5151
.invokeMethod('OneSignal#login', {'externalId': externalId});
@@ -62,7 +62,7 @@ class OneSignal {
6262
}
6363
}
6464

65-
/// Logout the user previously logged in via [login]. The [user] property now
65+
/// Logout the user previously logged in via [login]. The user property now
6666
///
6767
/// references a new device-scoped user. A device-scoped user has no user identity
6868
/// that can later be retrieved, except through this device as long as the app

lib/src/inappmessages.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class OneSignalInAppMessages {
4848
}
4949

5050
/// Get the trigger value associated with the key provided
51-
Future<Object?> clearTriggers() async {
51+
Future<void> clearTriggers() async {
5252
return await _channel.invokeMethod("OneSignal#clearTriggers");
5353
}
5454

pubspec.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
name: onesignal_flutter
22
description: OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your flutter app with OneSignal
3-
<<<<<<< Updated upstream
43
version: 5.0.0-beta-02
54
author: Brad Hesse <brad@onesignal.com>, Josh Kasten <josh@onesignal.com>, Henry Boswell <henryboswell@onesignal.com>
6-
=======
7-
version: 5.0.0-beta-01
8-
author: Brad Hesse <brad@onesignal.com>, Josh Kasten <josh@onesignal.com>
9-
>>>>>>> Stashed changes
105
homepage: https://github.com/OneSignal/OneSignal-Flutter-SDK
116

127
flutter:

0 commit comments

Comments
 (0)