Skip to content

Commit

Permalink
Merge pull request #88 from chmiiller/master
Browse files Browse the repository at this point in the history
Updates iOS One Signal SDK to 2.12.6. This is a major update since it:
  • Loading branch information
chmiiller authored Feb 21, 2020
2 parents 5714d54 + 44cf265 commit 7239838
Show file tree
Hide file tree
Showing 15 changed files with 135 additions and 84 deletions.
1 change: 0 additions & 1 deletion ios/Classes/ComWilliamrijksenOnesignalModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ typedef void(^TagsResultHandler)(NSDictionary*, NSError*);
- (void)deleteTag:(id)args;
- (void)getTags:(id)value;
- (void)setLogLevel:(id)args;
- (void)idsAvailable:(id)args;
- (void)postNotification:(id)arguments;

@end
24 changes: 3 additions & 21 deletions ios/Classes/ComWilliamrijksenOnesignalModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#import "ComWilliamrijksenOnesignalModule.h"
#import "OneSignalModuleHelper.h"
#import <OneSignal/OneSignal.h>
#import "TiBase.h"
#import "TiHost.h"
#import "TiUtils.h"
Expand Down Expand Up @@ -59,19 +60,17 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
};

id onesignalInitSettings = @{
kOSSettingsKeyAutoPrompt : @NO,
kOSSettingsKeyInFocusDisplayOption : @(OSNotificationDisplayTypeNone)
kOSSettingsKeyAutoPrompt : @false
};

NSString *OneSignalAppID = [[TiApp tiAppProperties] objectForKey:@"OneSignal_AppID"];
[OneSignal setLocationShared:NO];
[OneSignal initWithLaunchOptions:launchOptions
appId:OneSignalAppID
handleNotificationReceived:notificationReceivedBlock
handleNotificationAction:notificationOpenedBlock
settings:onesignalInitSettings];
[OneSignal setLocationShared:YES];

OneSignal.inFocusDisplayType = OSNotificationDisplayTypeNone;
return YES;
}

Expand Down Expand Up @@ -170,23 +169,6 @@ - (void)getTags:(id)args
}];
}

- (void)idsAvailable:(id)args
{
id value = args;
ENSURE_UI_THREAD(idsAvailable, value);
ENSURE_SINGLE_ARG(value, KrollCallback);

[OneSignal IdsAvailable:^(NSString* userId, NSString* pushToken) {
NSMutableDictionary *idsDict = [NSMutableDictionary dictionaryWithDictionary:@{
@"userId" : userId ?: @[],
@"pushToken" :pushToken ?: @[]
}];
NSArray *invocationArray = [[NSArray alloc] initWithObjects:&idsDict count:1];
[value call:invocationArray thisObject:self];
[invocationArray release];
}];
}

- (void)postNotification:(id)arguments
{
id args = arguments;
Expand Down
2 changes: 2 additions & 0 deletions ios/com.williamrijksen.onesignal.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DSTROOT = /tmp/ComWilliamrijksenOnesignal.dst;
Expand Down Expand Up @@ -261,6 +262,7 @@
baseConfigurationReference = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ENABLE_MODULES = YES;
DSTROOT = /tmp/ComWilliamrijksenOnesignal.dst;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand Down
6 changes: 3 additions & 3 deletions ios/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
# this is your module manifest and used by Titanium
# during compilation, packaging, distribution, etc.
#
version: 2.1.1
version: 2.2.0
apiversion: 2
architectures: armv7 arm64 i386 x86_64
description: com.williamrijksen.onesignal
author: William Rijksen
license: Specify your license
copyright: Copyright (c) 2018 by Enrise
copyright: Copyright (c) 2020 by Enrise

# these should not be edited
name: com.williamrijksen.onesignal
moduleid: com.williamrijksen.onesignal
guid: 67065763-fd5e-4069-a877-6c7fd328f877
platform: iphone
minsdk: 7.5.0.GA
minsdk: 8.0.0.GA
2 changes: 1 addition & 1 deletion ios/module.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
//
// IMPORTANT NOTE: always use $(inherited) in your overrides
//
OTHER_LDFLAGS=$(inherited) -framework UserNotifications
OTHER_LDFLAGS=$(inherited) -framework UserNotifications -framework Webkit -framework CoreGraphics
1 change: 1 addition & 0 deletions ios/platform/OneSignal.framework/Headers
Binary file removed ios/platform/OneSignal.framework/Info.plist
Binary file not shown.
1 change: 1 addition & 0 deletions ios/platform/OneSignal.framework/Modules
1 change: 1 addition & 0 deletions ios/platform/OneSignal.framework/Resources
Loading

0 comments on commit 7239838

Please sign in to comment.