Push Notifications & Deep linking

 

Deep linking by SDK

Our SDK provides default deep linking functionality for push notification categories buyview_cart and promotion by configuring deep linking URLs at the time of SDK initialization in AppDelegate.

Developers can override this behavior by implementing BlueShifPushDelegate methods inside AppDelegate

@interface AppDelegate : UIResponder <UIApplicationDelegate,BlueShiftPushDelegate>

- (void) buyPushActionWithDetails:(NSDictionary *)details;

Override buy button deep linking behavior of buy category push notifications.

- (void) viewPushActionWithDetails:(NSDictionary *)details;

Override view button deep linking behavior of buy category push notifications.

- (void) openCartPushActionWithDetails:(NSDictionary *)details;

Override open cart button deep linking behavior of view_cart category push notifications.

- (void) buyCategoryPushClickedWithDetails:(NSDictionary *)details;

Override deep linking behavior while clicking on push notification(category buy).

- (void) cartViewCategoryPushClickedWithDetails:(NSDictionary *)details;

Override deep linking behavior while clicking on push notification(category view_cart).

- (void) promotionCategoryPushClickedWithDetails:(NSDictionary *)details;

Override deep linking behavior while clicking on push notification(category promotion).

If you pass a deep linking URL along with a notification payload for categories 'buy', 'view_cart' and 'promotion' it will take this URL for all deep linking for that category by SDK by default, you can override this default by using one of the above delegate methods.

The SDK provides deep linking for other custom categories as well, you'll just need to pass the deep linking URL along with a push notification payload. The SDK will parse and deep link by default. Developers can override this behavior by implementing the following delegate:

- (void) handleCustomCategory:(NSString *)categroyName clickedWithDetails:(NSDictionary *)details;   

Override deep linking behavior while clicking on push notification(any custom category).

In order to deep link for an action button of any custom category, implement the following delegate in AppDelegate

- (void) handlePushActionForIdentifier:(NSString *)identifier withDetails:(NSDictionary *)details;

In order to get push notification data payloads inside the view controller after deep linking, implement the BlueShiftPushParamDelegate method inside your view controller

@interface YourViewController : UIViewController<BlueShiftPushParamDelegate>

- (void)handlePushDictionary:(NSDictionary *)pushDictionary;

In order to set up deep linking for each image in the carousel push notification, you'll need to follow these steps:

  1. Update both development and production provisioning profiles with App Group added.
  2. To add an App Group, go to your Apple developer portal and select Certificate, Identifiers and Profile.
  3. Select App Groups from the Identifiers section and add a new App Group ID.
  4. Select App IDs from the identifiers section and pick your app identifier from it.
  5. Select the Edit button, tick App Groups, press the Edit button and add select the App Group ID that you previously created.
  6. Select Notification content extension identifier from the App IDs list and do the same thing which was done for the App ID in step 4.
  7. In XCode under the project Targets, select you app schema.
  8. Select the Capabilities tab, then enable App Groups and add your App Group ID, and select it.
  9. Select notification content extension schema under Targets and do  step 7.
  10. Pass this App Group ID during SDK initialization [config setAppGroupID:@"App Group ID here"]; for objective C , config.appGroupID = "App Group ID here" for swift
  11. Pass the same group ID for notification content extension also, inside viewDidLoad in NotificationViewControllerself.appGroupID = @"App Group ID here";
 

Objective C

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any required interface initialization here.

    self.appGroupID = @"App Group ID here";
} 
 

Swift

override func viewDidLoad() {
    super.viewDidLoad()
    // Do any required interface initialization here.

    self.appGroupID = "App Group ID here"
}

The SDK will do default deep linking for each image. If you need to override it, you can implement the following delegate inside AppDelegate

- (void) handleCarouselPushForCategory:(NSString *)categoryName clickedWithIndex:(NSInteger)index withDetails:(NSDictionary *)details;
Was this article helpful?
0 out of 1 found this helpful

Comments

0 comments

Please sign in to leave a comment.