2013-01-31 21:22:37 +00:00
|
|
|
//
|
|
|
|
// GPPDeepLink.h
|
|
|
|
// Google+ iOS SDK
|
|
|
|
//
|
|
|
|
// Copyright 2012 Google Inc.
|
|
|
|
//
|
2013-04-27 21:14:05 +00:00
|
|
|
// Use of this SDK is subject to the Google+ Platform Terms of Service:
|
2013-01-31 21:22:37 +00:00
|
|
|
// https://developers.google.com/+/terms
|
|
|
|
//
|
|
|
|
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
|
2013-04-27 21:14:05 +00:00
|
|
|
@class GPPDeepLink;
|
|
|
|
|
|
|
|
// A protocol optionally implemented by the client of |GPPDeepLink|.
|
|
|
|
@protocol GPPDeepLinkDelegate
|
|
|
|
|
|
|
|
// Notifies the client that a deep link has been received either from
|
|
|
|
// |readDeepLinkAfterInstall| or |handleURL:sourceApplication:annotation:|.
|
|
|
|
- (void)didReceiveDeepLink:(GPPDeepLink *)deepLink;
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
// This class handles a deep link within a share posted on Google+.
|
|
|
|
// For more information on deep links, see
|
|
|
|
// http://developers.google.com/+/mobile/ios/share .
|
2013-01-31 21:22:37 +00:00
|
|
|
@interface GPPDeepLink : NSObject
|
|
|
|
|
2013-04-27 21:14:05 +00:00
|
|
|
// Sets the delegate to handle the deep link.
|
|
|
|
+ (void)setDelegate:(id<GPPDeepLinkDelegate>)delegate;
|
|
|
|
|
2013-01-31 21:22:37 +00:00
|
|
|
// Returns a |GPPDeepLink| for your app to handle, or |nil| if not found. The
|
|
|
|
// deep-link ID can be obtained from |GPPDeepLink|. It is stored when a user
|
|
|
|
// clicks a link to your app from a Google+ post, but hasn't yet installed your
|
|
|
|
// app. The user will be redirected to the App Store to install your app. This
|
|
|
|
// method should be called on or near your app launch to take the user to
|
2013-04-27 21:14:05 +00:00
|
|
|
// deep-link ID within your app. The delegate will be called if set and if a
|
|
|
|
// deep link is found.
|
2013-01-31 21:22:37 +00:00
|
|
|
+ (GPPDeepLink *)readDeepLinkAfterInstall;
|
|
|
|
|
|
|
|
// This method should be called from your |UIApplicationDelegate|'s
|
|
|
|
// |application:openURL:sourceApplication:annotation|. Returns
|
|
|
|
// |GooglePlusDeepLink| if |GooglePlusDeepLink| handled this URL, |nil|
|
2013-04-27 21:14:05 +00:00
|
|
|
// otherwise. The delegate will be called if set and if a deep link is found.
|
|
|
|
// Also see |handleURL:sourceApplication:annotation:| in |GPPURLHandler|.
|
2013-01-31 21:22:37 +00:00
|
|
|
+ (GPPDeepLink *)handleURL:(NSURL *)url
|
|
|
|
sourceApplication:(NSString *)sourceApplication
|
|
|
|
annotation:(id)annotation;
|
|
|
|
|
|
|
|
// The deep-link ID in |GPPDeepLink| that was passed to the app.
|
|
|
|
- (NSString *)deepLinkID;
|
|
|
|
|
2013-04-27 21:14:05 +00:00
|
|
|
// This instance method indicates where the user came from before arriving in
|
|
|
|
// your app. This method is provided for you to collect engagement metrics.
|
|
|
|
// For the possible values, see
|
|
|
|
// http://developers.google.com/+/mobile/ios/source-values .
|
2013-01-31 21:22:37 +00:00
|
|
|
- (NSString *)source;
|
|
|
|
|
|
|
|
@end
|