I've tried to add a working inApp purchase view inside an Action Extension.
As you know, in Action Extension we have 2 targets, one is the normal App (the app you can download from app store), and the second one the extension.
The view inApp purchase, works in the normal app (first target) but doesn't work in the extension target, I mean the loading purchase product is loop running without found the purchase product.
I've also opened API for the extension target (no restricted API) on building setting.
Any one know how to do?
I think you can do it in different way !
instead of trying to use in-App purchase on Action Extension itself
make the app checking on UserDefault with AppGroup !
.
This will help you on how to share UserDefault with App Extension by using it with AppGroup
That mean the user Must use the app first
then when the user make the purchased , you will change value from false to true
and save it to UserDefault
then when the user using the Action Extension
you will check the UserDefault
if the value changed to true
then the user can use the Action Extension
BTW : I remembered reading about Apple will rejected the app if the App Extension didn't do any functions !
So I think you need to add some limitation if the user didn't purchased
and remove the limitation after purchased
I hope this help you
Related
Is it possible to create Custom iOS Extension, probably of type Action
https://developer.apple.com/app-extensions/
And inside its content purchase product using in-app purchase ?
Let say I have limited app, with extension functionality and I want to give them option to buy it, while they are still inside their app, using extension itself.
I have a paid app that has been on the App Store for a year.
I am wanting make two changes to this app; 1) make the app free, and, 2) add advertising. But, I’m wanting to ensure that current users who purchased the app never see advertising.
Two solutions I have considered:
I could either completely delete the current app from iTunesConnect and the App Store then submit a brand new replacement app with a new Bundle ID.
Alternatively, in the current app, I could make a request to the App Store and check when the user first purchased the app as a way to determine whether or not to display advertising or not.
On the developer website I’ve read ‘Validating Receipts With the App Store’ and understand StoreKit and appStoreReceiptURL are involved, but am no clearer as to how to implement and achieve this in Swift 2.
Question:
Anyone experienced with such matters, in Swift 2, how do I make a successful request to the App Store and check the date when the user purchased the app?
Seems that the only approximate solution is to check the creation date of the app's document directory which is created when the app was installed in the device.
I don't think you can get the purchase date in your code. As a workaround you could check for the app version:
if let version = NSBundle.mainBundle().infoDictionary?["CFBundleShortVersionString"] as? String {
let versionNumber = Float(version)
if versionNumber < 1.xx
{
// .. Do something
}
}
I wondering what a best way to check in-app-purchase product status on app launching. Do I need to save purchase status on device or ask for status app store on every app launching?
Since iOS 7 is recommended to use the App Store receipt to save the status of IAP.
You can find out more in the docs. But in most cases is NSUserDefaults enough. E.g. I use IAPManager to handle all for me which persists all on the drive.
You should save in-app-purchase status on your device, using NSUserDefaultsfor example.
Imagine someone bought some in-app purchases from your app, and want to use it somewhere where the network is slow or doesn't work at all : if you doesn't store the information locally, then the user will be unable to use the unlocked features of your app.
This Ray Wenderlich tutorial concerning in-app purchases
provides an useful class, IAPHelper, which helps you manage your products easily, you should check it.
What I have done so far:
I have created a Today's widget via app extension for my containing app. Widget is working perfectly the way I want. My application has the feature of in-app purchases.
What I want:
I want the widget to not show up(even the name of widget) in Today's view unless the user don't make purchases from the containing app.
p.s
In-app purchases is working fine and I have a UserDefault in my Today's view controller which tells me whether user has made in-app purchases or not.
You don't get to make that choice.
If the today extension exists, it shows up in the list. No exceptions.
If the user enables the today extension, it's enabled.
What you would need to do is let the today extension be displayed, but without whatever functionality your in-app purchase enables. You can't have the extension and prevent it from appearing, but you can still control what it shows when it's visible.
I'm just gonna point out that enabling widget functionality via IAP will most probably get rejected from the App Store(as it recently did for me).
Here's the message I got in Resolution Center:
The Today Extension should provide some functionality before purchase
with IAP per the App Extension Programming Guide.
Usually i am going to
iTunes connect -> my app -> Manage In-App Purchase to add single item to the in app-purchase of my app.
I wanna to know if there is an API i can call it to add multiple files at once to the in-app purchase.
Help is appreciated
There is no such API. You should add all of them manually.
You have to add them manually. And check them during request. Store the appId in array and send the appropriate id with request from array. This is the only way to handle Multiple inAppp
No There is No Such API, You have to add them all for each tier you want to set.
for full app purchase setting and working check out Reywenderlich Full In-App purchase implementation
You can use the Application Loader from your Mac. There is a template there you can download and populate with your IAPs