Skip to content

Commit

Permalink
Updating Braze SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
hokstuff committed Aug 18, 2020
1 parent a9d3e07 commit 0656c30
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 14 deletions.
9 changes: 7 additions & 2 deletions Appboy-iOS-SDK.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Appboy-iOS-SDK"
s.version = "3.27.0-beta1"
s.version = "3.27.0-beta2"
s.summary = "This is the Braze iOS SDK for Mobile Marketing Automation"
s.homepage = "http://www.braze.com"
s.license = { :type => 'Commercial', :text => 'Please refer to https://github.com/Appboy/appboy-ios-sdk/blob/master/LICENSE'}
Expand All @@ -12,7 +12,12 @@ Pod::Spec.new do |s|
s.documentation_url = 'https://www.braze.com/docs'
s.exclude_files = 'AppboyKit/**/*.txt'
s.preserve_paths = 'AppboyKit/**/*.*'
s.pod_target_xcconfig = { 'OTHER_LDFLAGS' => '-ObjC' }
s.pod_target_xcconfig = {
'OTHER_LDFLAGS' => '-ObjC',

# Skipping this architecture to pass Pod validation since we explicitly remove simulator `arm64` ARCH to do lipo later
'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64'
}
s.default_subspec = 'UI'

s.subspec 'Core' do |sc|
Expand Down
8 changes: 5 additions & 3 deletions AppboyKit/headers/AppboyKitLibrary/ABKIDFADelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ NS_ASSUME_NONNULL_BEGIN
- (NSString *)advertisingIdentifierString;

/*!
* The result from [[ASIdentifierManager sharedManager] isAdvertisingTrackingEnabled].
* With iOS 14, the delegate should first check ATTrackingManager on iOS 14 and then check ASIdentifierManager on
* earlier iOS versions. An example implementation is included with Stopwatch here:
* https://github.com/Appboy/appboy-ios-sdk/blob/master/Example/Stopwatch/Sources/Utils/IDFADelegate.m
*
* @return If advertising tracking is enabled.
* @return YES if advertising tracking is enabled for iOS 14 and earlier or if AppTrackingTransparency (ATT) is authorized with iOS 14+, NO otherwise
*/
- (BOOL)isAdvertisingTrackingEnabled;
- (BOOL)isAdvertisingTrackingEnabledOrATTAuthorized;

@end
NS_ASSUME_NONNULL_END
2 changes: 1 addition & 1 deletion AppboyKit/headers/AppboyKitLibrary/Appboy.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#import <UserNotifications/UserNotifications.h>

#ifndef APPBOY_SDK_VERSION
#define APPBOY_SDK_VERSION @"3.27.0-beta1"
#define APPBOY_SDK_VERSION @"3.27.0-beta2"
#endif

#if !TARGET_OS_TV
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 3.27.0-beta2

- This release can be used to beta test iOS 14. See `3.27.0-beta1` notes for additional changes.

##### Breaking
- Updates `IDFADelegate` protocol by renaming `isAdvertisingTrackingEnabled` to `isAdvertisingTrackingEnabledOrATTAuthorized` to reflect the new requirements of iOS 14. See the `IDFADelegate` implementation [in Stopwatch for an example](https://github.com/Appboy/appboy-ios-sdk/blob/master/Example/Stopwatch/Sources/Utils/IDFADelegate.h).

## 3.27.0-beta1

- This release can be used to beta test iOS 14.
Expand All @@ -14,6 +21,15 @@
- Note that the Geofence feature will not work if the end user chooses to provide only approximate location.
- Optional session-start based location tracking will continue to work. Accuracy will be based on the user's precise vs. approximate choice.

## 3.26.1

##### Changed
- Deprecates the compilation macro `ABK_ENABLE_IDFA_COLLECTION` in favor of the `ABKIDFADelegate` implementation.
- `ABK_ENABLE_IDFA_COLLECTION` will not function properly in iOS 14. To continue collecting IDFA on iOS 14 devices, please upgrade to Xcode 12 and implement `App Tracking Transparency` and Braze's `ABKIDFADelegate` (see the [iOS 14 upgrade guide](https://www.braze.com/docs/developer_guide/platform_integration_guides/ios/ios_14/#idfa-and-app-tracking-transparency) for more information).

##### Added
- Adds improved support for iOS 14 Approximate Location tracking.

## 3.26.0

##### Breaking
Expand Down
4 changes: 4 additions & 0 deletions Example/Stopwatch.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
ADDAFB8E2107BAA30061C96E /* LocationCustomAttributeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = ADDAFB8D2107BAA30061C96E /* LocationCustomAttributeViewController.m */; };
ADDAFB912107C2080061C96E /* LocationAnnotation.m in Sources */ = {isa = PBXBuildFile; fileRef = ADDAFB902107C2080061C96E /* LocationAnnotation.m */; };
B24B1724248151AB00127211 /* CustomThemesDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = B24B1723248151AB00127211 /* CustomThemesDataSource.m */; };
B253831E24CF2CEF001575CA /* AppTrackingTransparency.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B253831D24CF2CEF001575CA /* AppTrackingTransparency.framework */; };
C12172081D5A3815003B986E /* UserNotifications.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C12172071D5A3815003B986E /* UserNotifications.framework */; };
C16085C61B964BC600E57F30 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = C16085C51B964BC600E57F30 /* libz.dylib */; };
C1C53F001F7D7CA700042AA5 /* UserNotifications.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C12172071D5A3815003B986E /* UserNotifications.framework */; };
Expand Down Expand Up @@ -205,6 +206,7 @@
ADDAFB902107C2080061C96E /* LocationAnnotation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LocationAnnotation.m; sourceTree = "<group>"; };
B24B1722248151AB00127211 /* CustomThemesDataSource.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CustomThemesDataSource.h; sourceTree = "<group>"; };
B24B1723248151AB00127211 /* CustomThemesDataSource.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CustomThemesDataSource.m; sourceTree = "<group>"; };
B253831D24CF2CEF001575CA /* AppTrackingTransparency.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppTrackingTransparency.framework; path = System/Library/Frameworks/AppTrackingTransparency.framework; sourceTree = SDKROOT; };
C03E52C51D46574A0065ABD6 /* he */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = he; path = he.lproj/Localizable.strings; sourceTree = "<group>"; };
C0A45ABC1E66155C0028C5DF /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Localizable.strings"; sourceTree = "<group>"; };
C12172071D5A3815003B986E /* UserNotifications.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UserNotifications.framework; path = System/Library/Frameworks/UserNotifications.framework; sourceTree = SDKROOT; };
Expand Down Expand Up @@ -272,6 +274,7 @@
E325DF481E2AE5FD00B3E168 /* MapKit.framework in Frameworks */,
C12172081D5A3815003B986E /* UserNotifications.framework in Frameworks */,
C16085C61B964BC600E57F30 /* libz.dylib in Frameworks */,
B253831E24CF2CEF001575CA /* AppTrackingTransparency.framework in Frameworks */,
4E3E94F318BD6AED0008C815 /* QuartzCore.framework in Frameworks */,
9580719E173D723400129B89 /* SystemConfiguration.framework in Frameworks */,
9580719F173D723400129B89 /* AssetsLibrary.framework in Frameworks */,
Expand Down Expand Up @@ -622,6 +625,7 @@
95EF510C173D5FD600C0D780 /* Frameworks */ = {
isa = PBXGroup;
children = (
B253831D24CF2CEF001575CA /* AppTrackingTransparency.framework */,
C17BCBCE1F7DCF2C00F65F39 /* AppboyPushStory.framework */,
E325DF471E2AE5FD00B3E168 /* MapKit.framework */,
E3688B1A1D6BB2DD0032091D /* UserNotificationsUI.framework */,
Expand Down
3 changes: 0 additions & 3 deletions Example/Stopwatch/Sources/Utils/IDFADelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,4 @@

@interface IDFADelegate : NSObject <ABKIDFADelegate>

- (NSString *)advertisingIdentifierString;
- (BOOL)isAdvertisingTrackingEnabled;

@end
8 changes: 6 additions & 2 deletions Example/Stopwatch/Sources/Utils/IDFADelegate.m
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
#import "IDFADelegate.h"
#import <AdSupport/ASIdentifierManager.h>
#import <AdSupport/ASIdentifierManager.h>
#import <AppTrackingTransparency/AppTrackingTransparency.h>

@implementation IDFADelegate

- (NSString *)advertisingIdentifierString {
return [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];
}

- (BOOL)isAdvertisingTrackingEnabled {
- (BOOL)isAdvertisingTrackingEnabledOrATTAuthorized {
if (@available(iOS 14, *)) {
return [ATTrackingManager trackingAuthorizationStatus] == ATTrackingManagerAuthorizationStatusAuthorized;
}
return [[ASIdentifierManager sharedManager] isAdvertisingTrackingEnabled];
}

Expand Down
18 changes: 16 additions & 2 deletions Example/Stopwatch/Sources/ViewControllers/CustomTabBarController.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#import "ContainerViewController.h"
#import "ABKLocationManager.h"
#import "ColorUtils.h"
#import <AppTrackingTransparency/AppTrackingTransparency.h>

@implementation CustomTabBarController

Expand All @@ -21,19 +22,32 @@ - (void)viewDidLoad {
[self addNavigationControllerWithChildren:@[@"Misc", @"Data", @"About"] andTitle:@"Advanced" andImageName:@"bolt" withFlushButton:NO], // Advanced tab
nil];
[self setViewControllers:viewControllers];


self.locationManager = [[CLLocationManager alloc] init];

[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(requestLocationAuthorization)
name:UIApplicationDidBecomeActiveNotification
object:nil];

self.locationManager = [[CLLocationManager alloc] init];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(requestAppTrackingTransperancyAuthorization)
name:UIApplicationDidBecomeActiveNotification
object:nil];
}

- (void)requestLocationAuthorization {
[self.locationManager requestAlwaysAuthorization];
}

- (void)requestAppTrackingTransperancyAuthorization {
if (@available(iOS 14, *)) {
[ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
NSLog(@"Got result from App Track Transparency popup %ld", (long)status);
}];
}
}

/* Helper methods for adding tab bar items to the root UITabBarController */

// Initializes and returns a ContainerViewController nested inside a UINavigationController
Expand Down
4 changes: 3 additions & 1 deletion Example/Stopwatch/Supporting Files/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.27.0-beta1</string>
<string>3.27.0-beta2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand Down Expand Up @@ -62,6 +62,8 @@
<string>Allow Stopwatch to access location information at all times.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Allow Stopwatch to access location information while in use.</string>
<key>NSUserTrackingUsageDescription</key>
<string>To retarget ads and build a global profile to better serve you things you would like.</string>
<key>UIBackgroundModes</key>
<array>
<string>remote-notification</string>
Expand Down

0 comments on commit 0656c30

Please sign in to comment.