-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
332 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
it(@"initializes appboy if an apiKey is passed", ^{ | ||
NSDictionary *settings = @{@"apiKey":@"foo"}; | ||
id appboyMock = OCMClassMock([Appboy class]); | ||
OCMExpect([appboyMock startWithApiKey:@"foo" inApplication:[OCMArg any] withLaunchOptions:nil]); | ||
OCMExpect([appboyMock startWithApiKey:@"foo" inApplication:[OCMArg any] withLaunchOptions:nil withAppboyOptions:[OCMArg any]]); | ||
SEGAppboyIntegration *appboyIntegration = [[SEGAppboyIntegration alloc] initWithSettings:settings]; | ||
OCMVerifyAllWithDelay(appboyMock, 2); | ||
}); | ||
|
@@ -29,7 +29,7 @@ | |
id appboyUserMock = OCMClassMock([ABKUser class]); | ||
OCMStub([appboyMock sharedInstance]).andReturn(appboyMock); | ||
OCMStub([appboyMock user]).andReturn(appboyUserMock); | ||
OCMExpect([appboyMock startWithApiKey:@"foo" inApplication:[OCMArg any] withLaunchOptions:nil]); | ||
OCMExpect([appboyMock startWithApiKey:@"foo" inApplication:[OCMArg any] withLaunchOptions:nil withAppboyOptions:[OCMArg any]]); | ||
OCMExpect([appboyMock changeUser:@"testUser"]); | ||
OCMExpect([appboyUserMock setDateOfBirth:testDate]); | ||
OCMExpect([appboyUserMock setEmail:@"[email protected]"]); | ||
|
@@ -72,7 +72,7 @@ | |
id appboyUserMock = OCMClassMock([ABKUser class]); | ||
OCMStub([appboyMock sharedInstance]).andReturn(appboyMock); | ||
OCMStub([appboyMock user]).andReturn(appboyUserMock); | ||
OCMExpect([appboyMock startWithApiKey:@"foo" inApplication:[OCMArg any] withLaunchOptions:nil]); | ||
OCMExpect([appboyMock startWithApiKey:@"foo" inApplication:[OCMArg any] withLaunchOptions:nil withAppboyOptions:[OCMArg any]]); | ||
OCMExpect([appboyMock changeUser:@"testUser"]); | ||
|
||
SEGAppboyIntegration *appboyIntegration = [[SEGAppboyIntegration alloc] initWithSettings:settings]; | ||
|
@@ -104,7 +104,7 @@ | |
NSDictionary *settings = @{@"apiKey":@"foo"}; | ||
id appboyMock = OCMClassMock([Appboy class]); | ||
OCMStub([appboyMock sharedInstance]).andReturn(appboyMock); | ||
OCMExpect([appboyMock startWithApiKey:@"foo" inApplication:[OCMArg any] withLaunchOptions:nil]); | ||
OCMExpect([appboyMock startWithApiKey:@"foo" inApplication:[OCMArg any] withLaunchOptions:nil withAppboyOptions:[OCMArg any]]); | ||
OCMExpect([appboyMock logPurchase:@"testPurchase" inCurrency:@"USD" atPrice:[NSDecimalNumber decimalNumberWithString:@"55.5"] | ||
withQuantity:1 andProperties:@{@"extraProperty" : @"extraValue"}]); | ||
|
||
|
@@ -123,12 +123,42 @@ | |
[appboyIntegration track:trackPayload]; | ||
OCMVerifyAllWithDelay(appboyMock, 2); | ||
}); | ||
|
||
it(@"calls logPurchase for each product in the products array", ^{ | ||
NSDictionary *settings = @{@"apiKey":@"foo"}; | ||
id appboyMock = OCMClassMock([Appboy class]); | ||
OCMStub([appboyMock sharedInstance]).andReturn(appboyMock); | ||
OCMExpect([appboyMock startWithApiKey:@"foo" inApplication:[OCMArg any] withLaunchOptions:nil withAppboyOptions:[OCMArg any]]); | ||
OCMExpect(([appboyMock logPurchase:@"product1" inCurrency:@"USD" atPrice:[NSDecimalNumber decimalNumberWithString:@"72.3"] | ||
withQuantity:29 andProperties:@{@"extraProperty" : @"extraValue", | ||
@"productProperty" : @"productValue" | ||
}])); | ||
|
||
SEGAppboyIntegration *appboyIntegration = [[SEGAppboyIntegration alloc] initWithSettings:settings]; | ||
|
||
NSDictionary *properties = @{ | ||
@"currency" : @"USD", | ||
@"extraProperty" : @"extraValue", | ||
@"products" : @[@{@"productId" : @"product1", | ||
@"price" : @"72.3", | ||
@"quantity" : @(29), | ||
@"productProperty" : @"productValue" | ||
}] | ||
}; | ||
|
||
SEGTrackPayload *trackPayload = [[SEGTrackPayload alloc] initWithEvent:@"Order Completed" | ||
properties:properties | ||
context:nil | ||
integrations:nil]; | ||
[appboyIntegration track:trackPayload]; | ||
OCMVerifyAllWithDelay(appboyMock, 2); | ||
}); | ||
|
||
it(@"logs an event if there isn't revenue", ^{ | ||
NSDictionary *settings = @{@"apiKey":@"foo"}; | ||
id appboyMock = OCMClassMock([Appboy class]); | ||
OCMStub([appboyMock sharedInstance]).andReturn(appboyMock); | ||
OCMExpect([appboyMock startWithApiKey:@"foo" inApplication:[OCMArg any] withLaunchOptions:nil]); | ||
OCMExpect([appboyMock startWithApiKey:@"foo" inApplication:[OCMArg any] withLaunchOptions:nil withAppboyOptions:[OCMArg any]]); | ||
NSDictionary *propertiesDictionary = @{ @"asdf" : @1, @"extraProperty" : @"extraValue"}; | ||
OCMExpect([appboyMock logCustomEvent:@"testEvent" withProperties:propertiesDictionary]); | ||
|
||
|
@@ -147,13 +177,12 @@ | |
}); | ||
}); | ||
|
||
|
||
describe(@"flush", ^{ | ||
it(@"calls [[Appboy sharedInstance] flushDataAndProcessRequestQueue]", ^{ | ||
NSDictionary *settings = @{@"apiKey":@"foo"}; | ||
id appboyMock = OCMClassMock([Appboy class]); | ||
OCMStub([appboyMock sharedInstance]).andReturn(appboyMock); | ||
OCMExpect([appboyMock startWithApiKey:@"foo" inApplication:[OCMArg any] withLaunchOptions:nil]); | ||
OCMExpect([appboyMock startWithApiKey:@"foo" inApplication:[OCMArg any] withLaunchOptions:nil withAppboyOptions:[OCMArg any]]); | ||
OCMExpect([appboyMock flushDataAndProcessRequestQueue]); | ||
SEGAppboyIntegration *appboyIntegration = [[SEGAppboyIntegration alloc] initWithSettings:settings]; | ||
[appboyIntegration flush]; | ||
|
@@ -167,8 +196,8 @@ | |
NSData *registerData = [[NSData alloc] init]; | ||
id appboyMock = OCMClassMock([Appboy class]); | ||
OCMStub([appboyMock sharedInstance]).andReturn(appboyMock); | ||
OCMExpect([appboyMock startWithApiKey:@"foo" inApplication:[OCMArg any] withLaunchOptions:nil]); | ||
OCMExpect([appboyMock registerPushToken:[OCMArg any]]); | ||
OCMExpect([appboyMock startWithApiKey:@"foo" inApplication:[OCMArg any] withLaunchOptions:nil withAppboyOptions:[OCMArg any]]); | ||
OCMExpect([appboyMock registerDeviceToken:[OCMArg any]]); | ||
SEGAppboyIntegration *appboyIntegration = [[SEGAppboyIntegration alloc] initWithSettings:settings]; | ||
[appboyIntegration registeredForRemoteNotificationsWithDeviceToken:registerData]; | ||
OCMVerifyAllWithDelay(appboyMock, 2); | ||
|
@@ -181,7 +210,7 @@ | |
NSDictionary *userInfo = @{@"test":@"userInfo"}; | ||
id appboyMock = OCMClassMock([Appboy class]); | ||
OCMStub([appboyMock sharedInstance]).andReturn(appboyMock); | ||
OCMExpect([appboyMock startWithApiKey:@"foo" inApplication:[OCMArg any] withLaunchOptions:nil]); | ||
OCMExpect([appboyMock startWithApiKey:@"foo" inApplication:[OCMArg any] withLaunchOptions:nil withAppboyOptions:[OCMArg any]]); | ||
OCMExpect([appboyMock registerApplication:[OCMArg any] didReceiveRemoteNotification:userInfo]); | ||
SEGAppboyIntegration *appboyIntegration = [[SEGAppboyIntegration alloc] initWithSettings:settings]; | ||
[appboyIntegration receivedRemoteNotification:userInfo]; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
fastlane documentation | ||
================ | ||
# Installation | ||
|
||
Make sure you have the latest version of the Xcode command line tools installed: | ||
|
||
``` | ||
xcode-select --install | ||
``` | ||
|
||
Install _fastlane_ using | ||
``` | ||
[sudo] gem install fastlane -NV | ||
``` | ||
or alternatively using `brew cask install fastlane` | ||
|
||
# Available Actions | ||
### matchFullAccess | ||
``` | ||
fastlane matchFullAccess | ||
``` | ||
|
||
### matchReadOnly | ||
``` | ||
fastlane matchReadOnly | ||
``` | ||
|
||
|
||
---- | ||
|
||
This README.md is auto-generated and will be re-generated every time [fastlane](https://fastlane.tools) is run. | ||
More information about fastlane can be found on [fastlane.tools](https://fastlane.tools). | ||
The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<testsuites> | ||
<testsuite name="fastlane.lanes"> | ||
|
||
|
||
|
||
|
||
<testcase classname="fastlane.lanes" name="0: Verifying fastlane version" time="0.056385"> | ||
|
||
</testcase> | ||
|
||
|
||
<testcase classname="fastlane.lanes" name="1: match" time="55.5746"> | ||
|
||
</testcase> | ||
|
||
|
||
<testcase classname="fastlane.lanes" name="2: match" time="54.038703"> | ||
|
||
</testcase> | ||
|
||
</testsuite> | ||
</testsuites> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#import <Foundation/Foundation.h> | ||
#import <UserNotifications/UserNotifications.h> | ||
|
||
@interface SEGAppboyHelper : NSObject | ||
|
||
- (void)applicationDidFinishLaunching; | ||
- (void)saveUserNotificationCenter:(UNUserNotificationCenter *)center | ||
notificationResponse:(UNNotificationResponse *)response NS_AVAILABLE_IOS(10_0); | ||
- (void)userNotificationCenter:(UNUserNotificationCenter *)center | ||
receivedNotificationResponse:(UNNotificationResponse *)response NS_AVAILABLE_IOS(10_0); | ||
|
||
@end |
Oops, something went wrong.