Skip to content

Commit 01027f7

Browse files
authored
Updated header doc and README for openURL:options: use. (#889)
1 parent 96a0021 commit 01027f7

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

Branch-SDK/Branch-SDK/Branch.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,11 @@ typedef NS_ENUM(NSUInteger, BranchCreditHistoryOrder) {
462462

463463
/**
464464
Call this method from inside your app delegate's `application:openURL:sourceApplication:annotation:`
465-
method with the so that Branch can open the passed URL.
465+
method so that Branch can open the passed URL. This method is for pre-iOS 9 compatibility: If you don't need
466+
pre-iOS 9 compatibility, override your app delegate's `application:openURL:options:` method instead and use
467+
the Branch `application:openURL:options:` to open the URL.
468+
469+
@warning Pre-iOS 9 compatibility only.
466470
467471
@param application The application that was passed to your app delegate.
468472
@param url The URL that was passed to your app delegate.
@@ -476,12 +480,10 @@ typedef NS_ENUM(NSUInteger, BranchCreditHistoryOrder) {
476480
annotation:(id)annotation;
477481

478482
/**
479-
Call this method from inside your app delegate's `application:openURL:options:`
480-
method with the so that Branch can open the passed URL.
483+
Call this method from inside your app delegate's `application:openURL:options:` method so that Branch can
484+
open the passed URL.
481485
482-
This method is functionally the same as calling the Branch method
483-
`application:openURL:sourceApplication:annotation:`. This method matches the new Apple appDelegate
484-
method for convenience.
486+
This is the preferred Branch method to call inside your `application:openURL:options:` method.
485487
486488
@param application The application that was passed to your app delegate.
487489
@param url The URL that was passed to your app delegate.

README.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -277,15 +277,14 @@ To deep link, Branch must initialize a session to check if the user originated f
277277
return YES;
278278
}
279279

280-
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
281-
280+
- (BOOL)application:(UIApplication *)application
281+
openURL:(NSURL *)url
282+
options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
282283
BOOL branchHandled =
283284
[[Branch getInstance]
284285
application:application
285286
openURL:url
286-
sourceApplication:sourceApplication
287-
annotation:annotation];
288-
287+
options:options];
289288
if (!branchHandled) {
290289
// do other deep link routing for the Facebook SDK, Pinterest SDK, etc
291290
}
@@ -316,13 +315,12 @@ func application(_ application: UIApplication, didFinishLaunchingWithOptions lau
316315
return true
317316
}
318317

319-
func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
320-
318+
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
321319
// Pass the url to the handle deep link call
322-
let branchHandled = Branch.getInstance().application(application,
320+
let branchHandled = Branch.getInstance().application(
321+
application,
323322
open: url,
324-
sourceApplication: sourceApplication,
325-
annotation: annotation
323+
options: options
326324
)
327325
if (!branchHandled) {
328326
// If not handled by Branch, do other deep link routing for the

0 commit comments

Comments
 (0)