forked from organicmaps/organicmaps
[ios] Added affiliate links
This commit is contained in:
parent
46dcd1aa37
commit
6101442e92
7 changed files with 14 additions and 10 deletions
|
@ -47,7 +47,7 @@
|
|||
|
||||
@interface UIApplication (URLs)
|
||||
|
||||
- (void)openProVersion;
|
||||
- (void)openProVersionFrom:(NSString *)launchPlaceName;
|
||||
- (void)openGuideWithName:(NSString *)guideName itunesURL:(NSString *)itunesURL;
|
||||
|
||||
@end
|
||||
|
|
|
@ -169,13 +169,18 @@
|
|||
|
||||
@implementation UIApplication (URLs)
|
||||
|
||||
- (void)openProVersion
|
||||
- (void)openProVersionFrom:(NSString *)launchPlaceName
|
||||
{
|
||||
NSURL * url = [NSURL URLWithString:MAPSWITHME_PREMIUM_LOCAL_URL];
|
||||
if ([self canOpenURL:url])
|
||||
{
|
||||
[self openURL:url];
|
||||
}
|
||||
else
|
||||
[self openURL:[NSURL URLWithString:MAPSWITHME_PREMIUM_APPSTORE_URL]];
|
||||
{
|
||||
NSString * urlString = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/app/id510623322?mt=8&at=1l3v7ya&ct=%@", launchPlaceName];
|
||||
[self openURL:[NSURL URLWithString:urlString]];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)openGuideWithName:(NSString *)guideName itunesURL:(NSString *)itunesURL
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
|
||||
#define FIRST_LAUNCH_KEY @"FIRST_LAUNCH_KEY"
|
||||
|
||||
#define MAPSWITHME_PREMIUM_APPSTORE_URL @"itms-apps://itunes.apple.com/app/id510623322"
|
||||
#define MAPSWITHME_PREMIUM_LOCAL_URL @"mapswithmepro://"
|
||||
#define MAPSWITHME_LITE_LOCAL_URL @"mapswithmelite://"
|
||||
|
||||
|
|
|
@ -408,7 +408,7 @@ NSString * const MWMProVersionPrefix = @"MWMPro";
|
|||
{
|
||||
if ([interstitial.imageType hasPrefix:MWMProVersionPrefix])
|
||||
{
|
||||
[[UIApplication sharedApplication] openProVersion];
|
||||
[[UIApplication sharedApplication] openProVersionFrom:@"mwm_interstitial"];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -430,7 +430,7 @@ NSString * const MWMProVersionPrefix = @"MWMPro";
|
|||
|
||||
if ([imageType hasPrefix:MWMProVersionPrefix])
|
||||
{
|
||||
[[UIApplication sharedApplication] openProVersion];
|
||||
[[UIApplication sharedApplication] openProVersionFrom:@"mwm_banner"];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -867,7 +867,7 @@ const long long LITE_IDL = 431183278L;
|
|||
else
|
||||
{
|
||||
[[Statistics instance] logProposalReason:@"Bookmark Screen" withAnswer:@"YES"];
|
||||
[[UIApplication sharedApplication] openProVersion];
|
||||
[[UIApplication sharedApplication] openProVersionFrom:@"mwm_side_menu_bookmarks"];
|
||||
}
|
||||
}
|
||||
else if ([itemName isEqualToString:@"Settings"])
|
||||
|
@ -935,7 +935,7 @@ const long long LITE_IDL = 431183278L;
|
|||
- (void)buyButtonPressed:(id)sender
|
||||
{
|
||||
[[Statistics instance] logProposalReason:@"Pro button on map" withAnswer:@"YES"];
|
||||
[[UIApplication sharedApplication] openProVersion];
|
||||
[[UIApplication sharedApplication] openProVersionFrom:@"mwm_bottom_map"];
|
||||
}
|
||||
|
||||
#pragma mark - UIKitViews delegates
|
||||
|
|
|
@ -145,7 +145,7 @@ using namespace::storage;
|
|||
if ([title isEqualToString:TitleMWM])
|
||||
{
|
||||
[[Statistics instance] logEvent:@"MoreApps MWM clicked"];
|
||||
[[UIApplication sharedApplication] openProVersion];
|
||||
[[UIApplication sharedApplication] openProVersionFrom:@"mwm_more_apps"];
|
||||
}
|
||||
else if ([title isEqualToString:TitleGuides])
|
||||
{
|
||||
|
|
|
@ -236,7 +236,7 @@ typedef enum {APIPOINT, POI, MYPOSITION} Type;
|
|||
if (buttonIndex != alertView.cancelButtonIndex)
|
||||
{
|
||||
// Launch appstore
|
||||
[[UIApplication sharedApplication] openProVersion];
|
||||
[[UIApplication sharedApplication] openProVersionFrom:@"mwm_balloon"];
|
||||
[[Statistics instance] logProposalReason:@"Balloon Touch" withAnswer:@"YES"];
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Add table
Reference in a new issue