-
Notifications
You must be signed in to change notification settings - Fork 86
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
652 additions
and
626 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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#import <Foundation/Foundation.h> | ||
#import <BrazeKit/BrazeKit-Swift.h> | ||
|
||
@interface BrazeReactDelegate: NSObject<BrazeDelegate> | ||
|
||
@end |
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,24 @@ | ||
#import "BrazeReactDelegate.h" | ||
#import <UIKit/UIKit.h> | ||
|
||
@implementation BrazeReactDelegate | ||
|
||
/// This delegate method determines whether to open a given URL. | ||
/// | ||
/// Reference the `BRZURLContext` object to get additional details about the URL payload. | ||
- (BOOL)braze:(Braze *)braze shouldOpenURL:(BRZURLContext *)context { | ||
if ([[context.url.host lowercaseString] isEqualToString:@"braze.com"]) { | ||
// Sample custom handling of universal links | ||
UIApplication *application = UIApplication.sharedApplication; | ||
NSUserActivity* userActivity = [[NSUserActivity alloc] initWithActivityType:NSUserActivityTypeBrowsingWeb]; | ||
userActivity.webpageURL = context.url; | ||
// Routes to the `continueUserActivity` method, which should be handled in your `AppDelegate`. | ||
[application.delegate application:application | ||
continueUserActivity:userActivity restorationHandler:^(NSArray<id<UIUserActivityRestoring>> * _Nullable restorableObjects) {}]; | ||
return NO; | ||
} | ||
// Let Braze handle links otherwise | ||
return YES; | ||
} | ||
|
||
@end |
Oops, something went wrong.