Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I'm looking at in-app purchases.
Essentially all the content is there and I just want an in-app purchase that lets the user purchase an item, and upon successful completion of the purchase will unlock an existing functionality.
I only need to unlock existing content.
Are there any plugins to allow this kind of thing?
When user successfully complete the purchase, your program will receive a delegate callback of
- (void)completeTransaction:(SKPaymentTransaction *)transaction;
and then you can record this transaction and post a NSNotification to notify other objects in your app to unlock some premium functionalities.
Also, you can store values in NSUserDefaults for next time to decide whether the functionality is unlocked.
Here is a sample code as reference.
- (void)completeTransaction:(SKPaymentTransaction *)transaction {
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
[userDefaults setBool:YES forKey:#"proVersionEnabled"];
[[NSNotificationCenter defaultCenter] postNotificationName:#"proVersionEnabledNotification" object:nil];
[[SKPaymentQueue defaultQueue] finishTransaction: transaction];
}
Your question is very generalized.
You need to be more specific. After successful transaction you just can use NSUserDefaults value or iOS Keychain to get value of a flag and unlock particular feature of your app.
Also I have a tutorial which could help you with this
http://nixsolutions.com/blog/development/iphone/in-app-purchase-tutorial/
Hope this helps.
Just set a bool in the user defaults if the premium content was puchased and check that bool to decide if you do or don't show the premium content.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Improve this question
I'm already finishing an app and I would like to make a tutorial embedded in the App, like those that appear as an overlay, explaining the functionality of every button, in the app until the user taps the screen.
Another option could be to show a tutorial the first time a user opens the app, but I don't know how to identify if is the first time a user opens the app.
Does anyone knows a good tutorial that shows how to do this?
Thank you!
Follow this link HERE. Its a tutorial for a tutorial you are trying to create using UIPageViewController.
and here is how you can detect the first time user loads the app:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
if ([[NSUserDefaults standardUserDefaults] boolForKey:#"HasLaunchedOnce"])
{
// app already launched
}
else
{
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:#"HasLaunchedOnce"];
[[NSUserDefaults standardUserDefaults] synchronize];
// This is the first launch ever
}
}
Hope this helps!
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
How would you go about performing a task once day?
In my case, I need to check if contact information has changed. (Contact information is in a big CSV file on amazon S3).
One way I thought is to save last date checked into a file then read it back from it when the application starts. But I feel that's so amateur.
Should I use core data? (Tested it a long while ago, just popped in my head).
Is there any better way of doing it?
You can achieve this by using NSUserDefaults on your AppDelegate.
An easy representation for saving;
[[NSUserDefaults standardUserDefaults] setObject:#"YourDateHere" forKey:#"lastAmazonCheckDate"];
[[NSUserDefaults standardUserDefaults] syncronize];
And retrieving;
[[NSUserDefaults standardUserDefaults] objectForKey:#"lastAmazonCheckDate"];
With NSUserDefaults you can save the last time you checked for your list.
_lastUpdate is a NSDate object
_lastUpdate = [NSDate date];
- (NSDate*)egoRefreshTableHeaderDataSourceLastUpdated:(EGORefreshTableHeaderView*)view
{
return _lastUpdate;
}
so like this you can check and update your task everyday i think you know this as you mentioned but i also have the only solution for now.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Is it possible to get your own device token from my own iPhone? I need it because I want to test Push-Notifications...
Thanks
You will need to use the -(void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken; method. Below is an example that will output your devices token as well as set it to a string.
-(void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
NSLog(#"APN device token: %#", deviceToken);
NSString *deviceTokenString = [NSString stringWithFormat:#"%#",deviceToken];
}
But, you should really be doing this already though so that you know where to send the notifications for your users, aren't you?
Edit after further clarification comment:
You weren't very specific at all in your question. To answer your more detailed question, you can't display it. As it is unique for each device AND each app. So your token for AppA is not the same as AppB.
The device token needed for push notification you will have in a callback function if you have subscribed to push notification. Until that not, unless you write doen the previous value.
Note the token for app in development / debug mode it is different from release/ad-hoc mode!!!
- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
{
NSLog(#"My token is: %#", deviceToken);
}
Please look at this tutorial. Also it is not working with simulator, and jailbroken devices
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
How can I accept credit card payments from within my iPhone app? The Credit Card Terminal is a good solution but that would mean my app's users have to have their iPhone app installed as well!
How can I do it all from within the app (using a UIWebView if need be)?
I did check out related questions on SO but none really answered the question.
This is not for in-app purchases (we can use StoreKit for that). This is for donations (and the app would be free as the Apple guidelines suggest)
Thanks.
May be you can donate through PayPal API but I am not sure whether Apple will approve it.
PayPal API for iOS:
https://www.x.com/community/ppx/xspaces/mobile/mep
Refer to this link before you start:
PayPal API for iOS - allowed?
I think there is no other option. UIWebView can open a site in your application which accepts credit card payments but I am not sure how good and appealing it would be to a user.
Hope this helps you
EDIT:
If you use anything apart from PayPal and In App Purchase, then I fear that your app will be rejected by Apple.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 5 years ago.
Improve this question
Quick question for anyone who is well informed on how the Apple iOS App review process works:
If I have an app that requires a login to use from a site that is not released yet, how does Apple test the application for crashes and such? Is this against the guidelines?
The thing is even when the site launches, which will be a day after the date I request the app to release by, only members of a certain community will be able to use it...
TLDR: How does Apple test iOS apps if it is login secured and they cannot obtain a login?
My understanding is that any sites etc that an app is dependant upon must be active at the time of submission in order for apple to correctly review the application - certainly on the apps I've submitted that refer to some kind of website I've always had to have something present and functioning at the appropriate web address.
If apple can't review the app they will fail it - without knowing your app it's difficult to be more specific - but without the login do you believe they can review it? If not you will likely fail.
Can the provider of the website provide a dumbed down version that functions just enough to allow the app to function correctly for app submission before releasing the full site the day after approval? Perhaps the provider can also set up a temporary redirection to another test only site which they can remove the day after launch?