Adding Subscription In-App Purchase to Safari Web Extension - swift

I have created a Safari Web Extension, now I want to add Subscription In-App Purchase into this app.
Since the Safari Web Extension has two parts: the Mac App and the Extension.
I want to ask can I add the IAP codes into the Extension part? So, the Extension can be programmatically enabled or disabled according to the latest subscription status.

You can send conditions from macOS app to their safari extension javascript executing file via SFSafariApplication.dispatchMessage
Send Messages from the App to JavaScript macOS
https://developer.apple.com/documentation/safariservices/safari_web_extensions/messaging_between_the_app_and_javascript_in_a_safari_web_extension
but for iOS there note
"You can’t send messages from a containing iOS app to your web extension’s JavaScript scripts."
So I'm looking solution right now how to end status ON/OFF to extension javascript file to toggle it depend on subscription status. It's strange how apple want us developers to monetize our extensions?

Related

How to track facebook installs on a Hybrid App

I need to add the tracking of installs for my Hybrid Mobile app but the code provided to me is only native for iOS and Android thus I cannot apply this to my project..
Is there a method I need to invoke from the Facebook SDK? I have integrated it already with my application as I utilize the Facebook Login. According to the guide: https://developers.facebook.com/docs/app-ads/sdk because it is a hybrid app it should automatically be tracked but this is not the case.
Any suggestions?

Chrome Packaged Apps: Opening another app

I am wondering whether there is any JS API to start another chrome app on button click event in a chrome packaged app.
As a general rule, no, you can't invoke another app.
However, if you control both apps, you can set the second app to expect an external message.
You can add chrome.runtime.onMessageExternal listener to the second app's event page script, and send a message with the app ID from the first to wake the second app and launch the app window. See this for more details.
In general, an extension can do this task and more thanks to the management API. It is, however, unavailable for Apps as of now.
Feature request to add this API for apps: #455550

How to make ios App Store link with parameters?

The new "smart app banners" have a method where you can pass parameters to yor app so that it can know, for examples what page on your site the user was on before they bought your app. This is useful, for example, with a news site where you ant to show them the article you were previously displaying.
The way to do this with he smart app banners is:
<meta name="apple-itunes-app" content="app-id=311507490, app-argument=http://bookID/1234"/>
Is there a way to make a general link that does this, instead of a smart app banner?
The advantage of smart app banners is that the iOS detects if the app is installed or not. If it is installed on the device the banner opens the app directly. Otherwise it takes you to the app store.
A disadvantage is that they only show up in mobile safari and they require iOS 6.
As an alternative you could use custom URL schemes. The application has to implement this scheme. The URL would look like this: myapp://bookID/1234.
You can also check if this link works (app is installed) using javascript.

How to change appstore application icon

Hi can any one suggest me it is possible or not and if possible then how?
The premise is that the user pays for the app via a website and they gets an access code to send to her guests via the website. The user downloads the free app from the iPhone store and enters the code. We're trying to figure out if we can enable each user to customize the app icon so it can appear with a different image or text on the user phone.
You can't. The application's icon (and the application's property list file) is in the application bundle, which cannot be modified.
This would also violate the iOS SDK Terms of Use and the iTunes Store Terms of Service; you cannot have a third-party receive payment to access a free iOS application.
You can customize the iOS icon of a web app clipping, and put the web site to be clipped behind your private paywall. Apple has been reported in the past to accept App store apps that generate URLs to customized clippable web apps. No idea if they currently or will continue to do so.
Icons on App store iOS apps for stock OS devices can only be changed by Apple approving an update.
Evan is right... This goes against so many terms of the iOS SDK.
One thing you could do (but I can't guarantee it will be accepted by Apple) is create a registration system on your website. Then have a login on the App as soon as it loads and check that the user has a valid account which has paid the subscription. You would have to handle all of your payment stuff on the webside though, meaning the app would be useless unless the user has already sorted that out. If you do this, on submission of your app make sure you provide Apple with a demo account username and password!
As for the icon, you can't change it once the App is submitted. It is bundled in with your app binary and there is also a logo included in iTunes connect. You can change them, but only by submitting a new binary.

How to launch Native App from Web app in iPhone?

I want to access TTS (Text-To-Speech) and STT (Speech-To-Text) functionality of iOS from web app. Since web app dont access ios device functions, is it possible to launch Native app from Web app?
e.g. When user wants to access TTS (e.g. Dragon Dictation), web page will launch Native app, take recording and send the recorded text to web app again.
Or we can access TTS/STT functionality right from web app?
The only native apps you can access from web apps are those with custom URL schemes set up, and the built-in ones e.g. SMS (sms://), phone (tel://), iTunes (itms://) and YouTube (http://youtube.com/watch?...).
If the apps you mention don't have their own custom URL schemes which you can use to get to them, there's no other way you can do this.
I can answer one part of your question - using the functionality of an IOS native app from a web-app;
Apps can be developed such that they respond to custom URL schemes - like, for example, the mail app responds to mailto:// and youtube responds to youtube://. Calling a URL with one of these schemes will start the IOS app - but it's entirely on the developer to code this into their application.
You could therefore in theory develop an app to get triggered from a web-app, perform an action then return to a web app after! Probably not something I would try and do though.