Skip to content
This repository has been archived by the owner on Oct 9, 2018. It is now read-only.

Commit

Permalink
app gifting link is not supported as of Dec-2013
Browse files Browse the repository at this point in the history
  • Loading branch information
Adar Porat committed May 22, 2014
1 parent ebb320c commit 434affb
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 37 deletions.
7 changes: 1 addition & 6 deletions example/iTellAFriendDemo/SettingsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 3;
return 2;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
Expand All @@ -67,9 +67,6 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
cell.textLabel.text = NSLocalizedString(@"Tell a Friend", "");
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
} else if (indexPath.row == 1) {
cell.textLabel.text = NSLocalizedString(@"Gift This App", "");
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
} else if (indexPath.row == 2) {
cell.textLabel.text = NSLocalizedString(@"Rate in App Store", "");
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
Expand All @@ -86,8 +83,6 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
[self presentViewController:tellAFriendController animated:YES completion:nil];
}
} else if (indexPath.row == 1) {
[[iTellAFriend sharedInstance] giftThisAppWithAlertView:YES];
} else if (indexPath.row == 2) {
[[iTellAFriend sharedInstance] rateThisAppWithAlertView:YES];
}

Expand Down
11 changes: 0 additions & 11 deletions src/iTellAFriend.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,6 @@
*/
- (UINavigationController *)tellAFriendController;

/**
* Lanuches the gift app itunes screen
*/
- (void)giftThisApp;

/**
* Lanuches the gift app itunes screen, with optional informational alert view
* @param showAlertView optional informational alert view
*/
- (void)giftThisAppWithAlertView:(BOOL)showAlertView;

/**
* Lanuches the app store rate this app screen
*/
Expand Down
21 changes: 1 addition & 20 deletions src/iTellAFriend.m
Original file line number Diff line number Diff line change
Expand Up @@ -183,23 +183,6 @@ - (UINavigationController *)tellAFriendController
return picker;
}

- (void)giftThisApp
{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:iTellAFriendGiftiOSiTunesURLFormat, (unsigned long)self.appStoreID]]];
}

- (void)giftThisAppWithAlertView:(BOOL)showAlertView
{
if (showAlertView) {
UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Gift This App", @"") message:[NSString stringWithFormat:NSLocalizedString(@"You really enjoy using %@. Your family and friends will love you for giving them this app.", @""), self.applicationName] delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", @"") otherButtonTitles:NSLocalizedString(@"Gift", @""), nil];
alertView.tag = 1;
[alertView show];

} else {
[self giftThisApp];
}
}

- (void)rateThisApp
{

Expand All @@ -224,9 +207,7 @@ - (void)rateThisAppWithAlertView:(BOOL)showAlertView

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (alertView.tag==1 && buttonIndex==1) {
[self giftThisApp];
} else if (alertView.tag==2 && buttonIndex==1) {
if (alertView.tag==2 && buttonIndex==1) {
[self rateThisApp];
}
}
Expand Down

0 comments on commit 434affb

Please sign in to comment.