Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 1A664200CBC for ; Tue, 20 Jun 2017 21:37:41 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 18754160BE1; Tue, 20 Jun 2017 19:37:41 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 5DC1C160BCC for ; Tue, 20 Jun 2017 21:37:40 +0200 (CEST) Received: (qmail 36942 invoked by uid 500); 20 Jun 2017 19:37:39 -0000 Mailing-List: contact dev-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list dev@cordova.apache.org Received: (qmail 36931 invoked by uid 99); 20 Jun 2017 19:37:39 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Jun 2017 19:37:39 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 27FB5DFF18; Tue, 20 Jun 2017 19:37:39 +0000 (UTC) From: shazron To: dev@cordova.apache.org Reply-To: dev@cordova.apache.org References: In-Reply-To: Subject: [GitHub] cordova-ios pull request #321: CB-12937 - (iOS) added new method handleOpenU... Content-Type: text/plain Message-Id: <20170620193739.27FB5DFF18@git1-us-west.apache.org> Date: Tue, 20 Jun 2017 19:37:39 +0000 (UTC) archived-at: Tue, 20 Jun 2017 19:37:41 -0000 Github user shazron commented on a diff in the pull request: https://github.com/apache/cordova-ios/pull/321#discussion_r123074527 --- Diff: CordovaLib/Classes/Public/CDVPlugin.m --- @@ -140,6 +142,36 @@ - (void)handleOpenURL:(NSNotification*)notification } } +/* + NOTE: calls into JavaScript must not call or trigger any blocking UI, like alerts + */ +- (void)handleOpenURLWithApplicationSourceAndAnnotation: (NSNotification*)notification +{ + + // override to handle urls sent to your app + // register your url schemes in your App-Info.plist + + // The notification object is an NSDictionary which contains + // - url which is a type of NSURL + // - sourceApplication which is a type of NSString and represents the package + // id of the app that calls our app + // - annotation which a type of Property list which can be several different types + // please see https://developer.apple.com/library/content/documentation/General/Conceptual/DevPedia-CocoaCore/PropertyList.html + + NSDictionary* notificationData = [notification object]; + + if ([notificationData isKindOfClass: NSDictionary.class]){ + + NSURL* url = notificationData[@"url"]; + NSString* sourceApplication = notificationData[@"sourceApplication"]; --- End diff -- I know it's trivial, but I would add the line where you extract the annotation here as well, to be complete, for users that rely on looking at source code on how to get at the data (who usually are not proficient at Obj-C) --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org For additional commands, e-mail: dev-help@cordova.apache.org