Skip to content

Commit 3bd068a

Browse files
author
Edward Smith
committed
Fixed category linking. Fixed carthage build. Updated change log.
1 parent b2a4f77 commit 3bd068a

File tree

6 files changed

+45
-4
lines changed

6 files changed

+45
-4
lines changed

Branch-SDK/Branch-SDK/Branch.m

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#import "BranchSpotlightUrlRequest.h"
3535
#import "BranchRegisterViewRequest.h"
3636
#import "BranchContentDiscoverer.h"
37+
#import "NSMutableDictionary+Branch.h"
3738

3839
//Fabric
3940
#import "../Fabric/FABKitProtocol.h"
@@ -68,6 +69,18 @@
6869
NSString * const BNCShareInitiatedEvent = @"Share Started";
6970
NSString * const BNCShareCompletedEvent = @"Share Completed";
7071

72+
73+
#pragma mark - Load Categories
74+
75+
void ForceCategoriesToLoad();
76+
void ForceCategoriesToLoad() {
77+
ForceNSMutableDictionaryToLoad();
78+
}
79+
80+
81+
#pragma mark - Branch
82+
83+
7184
@interface Branch() <BranchDeepLinkingControllerCompletionDelegate, FABKit>
7285

7386

@@ -147,6 +160,9 @@ + (Branch *)getInstance:(NSString *)branchKey {
147160

148161
- (id)initWithInterface:(BNCServerInterface *)interface queue:(BNCServerRequestQueue *)queue cache:(BNCLinkCache *)cache preferenceHelper:(BNCPreferenceHelper *)preferenceHelper key:(NSString *)key {
149162
if (self = [super init]) {
163+
164+
ForceCategoriesToLoad();
165+
150166
_bServerInterface = interface;
151167
_bServerInterface.preferenceHelper = preferenceHelper;
152168
_requestQueue = queue;

Branch-SDK/Branch-SDK/NSMutableDictionary+Branch.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
#import <Foundation/Foundation.h>
1111

1212

13+
void ForceNSMutableDictionaryToLoad();
14+
15+
1316
@interface NSMutableDictionary (Branch)
1417

1518
- (void) bnc_safeSetObject:(id)anObject forKey:(id<NSCopying>)aKey;

Branch-SDK/Branch-SDK/NSMutableDictionary+Branch.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,8 @@ - (void) bnc_safeAddEntriesFromDictionary:(NSDictionary<id<NSCopying>,id> *)othe
2525
}
2626

2727
@end
28+
29+
30+
void ForceNSMutableDictionaryToLoad() {
31+
// Does nothing. But will force the linker to include this category.
32+
}

Branch-TestBed/Branch-TestBed.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,23 +621,23 @@
621621
E2B9474A1D15D75000F2270D /* BNCCallbacks.h in Headers */,
622622
54FF1F951BD20EB50004CE2E /* BranchRegisterViewRequest.h in Headers */,
623623
46946B851B26898800627BCC /* BNCServerRequest.h in Headers */,
624-
466D5A111B5991E3009DB845 /* BNCContentDiscoveryManager.h in Headers */,
625624
466B58741B17780A00A69EDE /* BNCPreferenceHelper.h in Headers */,
626625
4D8EE7A51E1F0A5D00B1F450 /* BNCCommerceEvent.h in Headers */,
627626
4D35141B1E3201D80085EBA1 /* NSMutableDictionary+Branch.h in Headers */,
628627
466B58791B17780A00A69EDE /* BNCConfig.h in Headers */,
629628
7D4DAC211C8FA8C0008E37DB /* BranchView.h in Headers */,
630629
7D4DAC271C8FA908008E37DB /* BranchViewHandler.h in Headers */,
631630
54391A151BA249FA0061CB0F /* BranchCSSearchableItemAttributeSet.h in Headers */,
631+
466D5A111B5991E3009DB845 /* BNCContentDiscoveryManager.h in Headers */,
632632
54FF1F8D1BD1D4AE0004CE2E /* BranchUniversalObject.h in Headers */,
633633
46946B9F1B2689A100627BCC /* BranchShortUrlSyncRequest.h in Headers */,
634634
46946B9E1B2689A100627BCC /* BranchShortUrlRequest.h in Headers */,
635635
466B58781B17780A00A69EDE /* BNCServerRequestQueue.h in Headers */,
636636
466B58751B17780A00A69EDE /* BNCServerInterface.h in Headers */,
637637
46946B981B2689A100627BCC /* BranchLoadRewardsRequest.h in Headers */,
638638
466B587B1B17780A00A69EDE /* BNCServerResponse.h in Headers */,
639-
466B587F1B17780A00A69EDE /* BNCEncodingUtils.h in Headers */,
640639
460F4FA71B618A38002E84D6 /* BranchSpotlightUrlRequest.h in Headers */,
640+
466B587F1B17780A00A69EDE /* BNCEncodingUtils.h in Headers */,
641641
54FF1F911BD1DC320004CE2E /* BranchLinkProperties.h in Headers */,
642642
4D8999EC1DC108FF00F7EE0A /* BNCXcode7Support.h in Headers */,
643643
67486B8D1B93B48A0044D872 /* BNCStrongMatchHelper.h in Headers */,

ChangeLog.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,20 @@ Branch iOS SDK Change Log
22

33
- v0.12.25
44
* > Beta Release <
5-
* Added a beta release deployment script.
5+
* Added a deployment script for beta releases.
6+
* Fixed crashes related to nil values being inserted into a dictionary (GH #551 & #552).
7+
* Made callback block properties atomic/copy to prevent a possible crashes due to race conditions.
8+
* In the BNCServerInterface code, the code blocks for NSURLSessionCompletionHandler and
9+
NSURLConnectionCompletionHandler are now copied blocks rather global static blocks.
10+
This prevents a crash when the block is deallocated or reallocated (GH #548).
11+
* Added a Swift example for the new Branch commerce event, `BNCCommerceEvent`, in the
12+
TestBed-Swift project.
613

714
- v0.12.24
815
* Updated Fabric files.
916
* Made the release script more robust.
1017
* Made changes to the Safari Strong Match Helper to ensure that:
11-
- Safari doesn't steal the firstResponder status.
18+
- Safari doesn't steal the firstResponder status.
1219
- The hidden Safari view is inserted correctly into the ViewController / View hierarchy.
1320

1421
- v0.12.23

carthage-files/BranchSDK.xcodeproj/project.pbxproj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
/* Begin PBXBuildFile section */
1010
4D19C1C21DC110FB008D8B38 /* BNCXcode7Support.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D19C1C01DC110FA008D8B38 /* BNCXcode7Support.h */; };
1111
4D19C1C31DC110FB008D8B38 /* BNCXcode7Support.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D19C1C11DC110FB008D8B38 /* BNCXcode7Support.m */; };
12+
4D291AAB1E322ECC007ED118 /* NSMutableDictionary+Branch.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D291AA91E322ECC007ED118 /* NSMutableDictionary+Branch.h */; };
13+
4D291AAC1E322ECC007ED118 /* NSMutableDictionary+Branch.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D291AAA1E322ECC007ED118 /* NSMutableDictionary+Branch.m */; };
1214
4D3922BD1E1F0C85004FB7C8 /* BNCCommerceEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D3922BC1E1F0C85004FB7C8 /* BNCCommerceEvent.h */; settings = {ATTRIBUTES = (Public, ); }; };
1315
4D3FA94D1DFF3F6C00E2B6A9 /* BNCConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D3FA94C1DFF3F6C00E2B6A9 /* BNCConfig.m */; };
1416
4DA40A8F1E1F0011004D2534 /* BNCCommerceEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 4DA40A8D1E1F0011004D2534 /* BNCCommerceEvent.m */; };
@@ -97,6 +99,8 @@
9799
/* Begin PBXFileReference section */
98100
4D19C1C01DC110FA008D8B38 /* BNCXcode7Support.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BNCXcode7Support.h; sourceTree = "<group>"; };
99101
4D19C1C11DC110FB008D8B38 /* BNCXcode7Support.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BNCXcode7Support.m; sourceTree = "<group>"; };
102+
4D291AA91E322ECC007ED118 /* NSMutableDictionary+Branch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMutableDictionary+Branch.h"; sourceTree = "<group>"; };
103+
4D291AAA1E322ECC007ED118 /* NSMutableDictionary+Branch.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSMutableDictionary+Branch.m"; sourceTree = "<group>"; };
100104
4D3922BC1E1F0C85004FB7C8 /* BNCCommerceEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BNCCommerceEvent.h; sourceTree = "<group>"; };
101105
4D3FA94C1DFF3F6C00E2B6A9 /* BNCConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BNCConfig.m; sourceTree = "<group>"; };
102106
4DA40A8D1E1F0011004D2534 /* BNCCommerceEvent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BNCCommerceEvent.m; sourceTree = "<group>"; };
@@ -263,6 +267,8 @@
263267
E230A13E1D03DB9E006181D8 /* BranchView.m */,
264268
E230A13F1D03DB9E006181D8 /* BranchViewHandler.h */,
265269
E230A1401D03DB9E006181D8 /* BranchViewHandler.m */,
270+
4D291AA91E322ECC007ED118 /* NSMutableDictionary+Branch.h */,
271+
4D291AAA1E322ECC007ED118 /* NSMutableDictionary+Branch.m */,
266272
E230A1411D03DB9E006181D8 /* Requests */,
267273
);
268274
name = "Branch-SDK";
@@ -377,6 +383,7 @@
377383
4D19C1C21DC110FB008D8B38 /* BNCXcode7Support.h in Headers */,
378384
E230A1AC1D03DB9E006181D8 /* BranchRedeemRewardsRequest.h in Headers */,
379385
E230A1AE1D03DB9E006181D8 /* BranchRegisterViewRequest.h in Headers */,
386+
4D291AAB1E322ECC007ED118 /* NSMutableDictionary+Branch.h in Headers */,
380387
E230A18F1D03DB9E006181D8 /* BranchLinkProperties.h in Headers */,
381388
E230A1BC1D03DB9F006181D8 /* PromoViewHandler.h in Headers */,
382389
E230A1881D03DB9E006181D8 /* BranchActivityItemProvider.h in Headers */,
@@ -486,6 +493,7 @@
486493
E230A1761D03DB9E006181D8 /* BNCLinkCache.m in Sources */,
487494
E230A1AD1D03DB9E006181D8 /* BranchRedeemRewardsRequest.m in Sources */,
488495
7DA3BF1D1D889CE500CA8AE0 /* BranchContentDiscoverer.m in Sources */,
496+
4D291AAC1E322ECC007ED118 /* NSMutableDictionary+Branch.m in Sources */,
489497
E230A1971D03DB9E006181D8 /* BranchViewHandler.m in Sources */,
490498
E230A1801D03DB9E006181D8 /* BNCServerResponse.m in Sources */,
491499
E230A1A91D03DB9E006181D8 /* BranchLogoutRequest.m in Sources */,
@@ -610,6 +618,7 @@
610618
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
611619
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
612620
MODULEMAP_FILE = "$(SRCROOT)/module.modulemap";
621+
OTHER_LDFLAGS = "-ObjC";
613622
PRODUCT_BUNDLE_IDENTIFIER = "com.branch.ios-carthage";
614623
PRODUCT_MODULE_NAME = "$(TARGET_NAME)";
615624
PRODUCT_NAME = Branch;
@@ -629,6 +638,7 @@
629638
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
630639
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
631640
MODULEMAP_FILE = "$(SRCROOT)/module.modulemap";
641+
OTHER_LDFLAGS = "-ObjC";
632642
PRODUCT_BUNDLE_IDENTIFIER = "com.branch.ios-carthage";
633643
PRODUCT_MODULE_NAME = "$(TARGET_NAME)";
634644
PRODUCT_NAME = Branch;

0 commit comments

Comments
 (0)