From dbc5170276c963e4a93853f3d5cab372669b3f9e Mon Sep 17 00:00:00 2001 From: Nan Date: Wed, 31 Jan 2024 12:15:45 -0800 Subject: [PATCH] Fix after rebase: File differences * OSFlutterUser.h - This file got deleted, so add it back * debug.dart - Renamed * Runner/Info.plist - small differences fixed * Runner.xcodeproj/project.pbxproj - small differences fixed --- example/ios/Runner.xcodeproj/project.pbxproj | 4 ++- example/ios/Runner/Info.plist | 2 ++ example/lib/main.dart | 28 ++++++--------- ios/Classes/OSFlutterUser.h | 36 ++++++++++++++++++++ lib/src/{onesignaldebug.dart => debug.dart} | 0 5 files changed, 51 insertions(+), 19 deletions(-) create mode 100644 ios/Classes/OSFlutterUser.h rename lib/src/{onesignaldebug.dart => debug.dart} (100%) diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 7afe0a69..562d06cd 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -329,6 +329,7 @@ /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -421,6 +422,7 @@ }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); diff --git a/example/ios/Runner/Info.plist b/example/ios/Runner/Info.plist index 33e4685b..51a46c90 100644 --- a/example/ios/Runner/Info.plist +++ b/example/ios/Runner/Info.plist @@ -50,5 +50,7 @@ CADisableMinimumFrameDurationOnPhone + UIApplicationSupportsIndirectInputEvents + diff --git a/example/lib/main.dart b/example/lib/main.dart index 5e4fafda..65cbb785 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -117,19 +117,11 @@ class _MyAppState extends State { void _handleSendTags() { print("Sending tags"); - // OneSignal.shared.sendTag("test2", "val2").then((response) { - // print("Successfully sent tags with response: $response"); - // }).catchError((error) { - // print("Encountered an error sending tags: $error"); - // }); + OneSignal.User.addTagWithKey("test2", "val2"); print("Sending tags array"); - var sendTags = {'test': 'value'}; - // OneSignal.shared.sendTags(sendTags).then((response) { - // print("Successfully sent tags with response: $response"); - // }).catchError((error) { - // print("Encountered an error sending tags: $error"); - // }); + var sendTags = {'test': 'value', 'test2': 'value2'}; + OneSignal.User.addTags(sendTags); } void _handleRemoveTag() { @@ -159,29 +151,29 @@ class _MyAppState extends State { } void _handleSetEmail() { - // if (_emailAddress == null) return; - + if (_emailAddress == null) return; print("Setting email"); OneSignal.User.addEmail(_emailAddress!); } - void _handleSetLanguage() { - // if (_language == null) return; + void _handleRemoveEmail() { + if (_emailAddress == null) return; + print("Remove email"); OneSignal.User.removeEmail(_emailAddress!); } void _handleSetSMSNumber() { if (_smsNumber == null) return; - print("Setting SMS Number"); OneSignal.User.addSms(_smsNumber!); } - void _handleLogoutSMSNumber() { - print("Logging out of smsNumber"); + void _handleRemoveSMSNumber() { + if (_smsNumber == null) return; + print("Remove smsNumber"); OneSignal.User.removeSms(_smsNumber!); } diff --git a/ios/Classes/OSFlutterUser.h b/ios/Classes/OSFlutterUser.h new file mode 100644 index 00000000..6cbaf533 --- /dev/null +++ b/ios/Classes/OSFlutterUser.h @@ -0,0 +1,36 @@ +/** + * Modified MIT License + * + * Copyright 2017 OneSignal + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * 1. The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * 2. All copies of substantial portions of the Software may only be used in connection + * with services provided by OneSignal. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + + +#import +#import + +@interface OSFlutterUser : NSObject + +@property (strong, nonatomic) FlutterMethodChannel *channel; + +@end diff --git a/lib/src/onesignaldebug.dart b/lib/src/debug.dart similarity index 100% rename from lib/src/onesignaldebug.dart rename to lib/src/debug.dart