Enable Today's View widget via in-app purchase - in-app-purchase

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.

Related

How/where to integrate Admob in combination with In-app purchase "No ads"?

This is mostly an architectural question for SwiftUI:.
I have developed my first app for iPhone, and would like to use Admob ads with the option for the user to buy an in-app purchase to remove the ads.
I initialize AdMob in my App-file containing the #main, in the viewDidLoad function, the test ads display fine.
I want to use new In-App purchase interface for IOS15. I have tried to access the user's "products" from the same file but I got stuck with concurrency issues: "'async' call in a function that does not support concurrency".
Thus I moved this code to my ViewModel, but then AdMob always gets initialized, even though the user has purchased the No Ads option. .
Does AdMob track the user even though no ads are displayed? .
Thus: my question is - how should this be designed correctly - where to initialize AdMob, where to check for in-app purchases?
I hope that my question makes sense to you, as I said, this is my first app!

Swift showing Promo Code View for In App purchase not doing anything

I tried adding a function for Promo-Codes so I can give some users something for free.
I created a Promo-Code inside App Store Connect and this is my function to open the PromoCodeView:
#objc func promoCodeButtonTapped() {
let paymentQueue = SKPaymentQueue.default()
if #available(iOS 14.0, *) {
paymentQueue.presentCodeRedemptionSheet()
}
}
The view is presented properly. However I can't do anything there. I can type in a code or cancel but I can not confirm or anything. What am I missing here?? I am running it on the live-version btw. I know I can not test it in development.
The App is live! If you want to test it yourself:
https://apps.apple.com/de/app/wishlists-einfach-w%C3%BCnschen/id1503912334
Generated Promo Code for the In-App Purchase:
HE9T64F74JHT
If one can make it work, he can get Premium of my app for free with this code :D (Profile -> Premium Membership -> Promo Code )
You have a slight misunderstanding of how promo codes work, and to be honest, it is a little confusing on Apple's part.
presentCodeRedemptionSheet is only used to redeem promo codes associated with an auto-renewing subscription. Promo codes for other IAP types are redeemed through the App Store app. Since your IAP is a non-consumable this applies to your app.
I was able to redeem the code you supplied using the following process:
Access my account in the App Store app (Tap my picture in the top right corner)
Select "Redeem gift card or code"
Paste the code
Open your app and receive the "Thanks for the beer" message (Since the redemption is simply presented to your payment queue observer as a purchase).
There does seem to be an issue with your code, however, as I can't change my profile picture and I get an error that I need to be a premium user.
I tried to purchase the upgrade directly and got a message from Apple that it was free since I already owned it; but I am still a Llama :(
You can remove the "Promo code" button from your UI; It isn't applicable in your case.

iOS In-App purchase inside Action Extension

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.

iOS InApp Purchase in Action Extension app

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

Swift - IOS - Limited time features

I want to make a limited time promotion of my app, if you download in that day there should be no advertising forever, how do I implement it?
I can put the in app purchase free but i want something more automatic
I already implemented in-app purchase but I don't know if I can automatize it with a code like
if (date==27/07/2016){
purchase()
if (purchase ok)
popup("congratulations")}
Apple allows code like this for in-app purchases?Which class I have to use to check day/month/year?
In alternative to in-app purchases I was thinking about NSUserDefaults but if the user deletes and redownloads the app he loses the feature,and i don't know what will happen with future updates
What can I use in alternative to in-app purchase to remove ads in a permanent way?
Have two IAPs, both for the same thing. One is free, one not. Only have the button get the free one on the promo date.

Resources