Is there any way to use Apple In App purchases from a UIWebView inside the application ?
Since i want to use a web view to load an external website and use in app purchases as payement method inside the app.
You can call Objective-C methods from UIWebView. This you can do by trapping your custom urls in the shouldStartLoadWithRequest: method. As well, you can call JS methods in HTML from Objective-C code (stringByEvaluatingJavaScriptFromString:). Details are here.
I think it is possible to use Apple's InApp purchase from inside UIWebView, though it depends on your exact requirements. As long as you use Apple's payment gateway (so that they get their 30% cut :)) it's okay.
I don't think it works that way. It's a Cocoa touch API and has to be called from a Cocoa object / controller.
It also uses delegates to communicate back with your app.
Also sounds like what you are trying to do is use the in app purchase as your payment system for a web app. Might be outside the terms of service of AppStore.
Try Google In App Payments?
Related
I would like to have a link on my mobile website that once clicked from an iOS device, it will open up the Apple Wallet app.
I know there are some questions about this subject when it comes to an app that I built, but since this is not the case here, I'm not sure what is the right approach. I'm also aware of Brnach.io, but again, I think this solution is for an app I own, and I'm not sure how I can implement it for apps created by Apple (or other 3rd party developers) and specifically Apple Wallet (for example: how do I get the app ID?).
I know Universal Links might also be an option but I've read that I can't use an automated redirect with them (which I will need to do too)
Use this in your URL- shoebox://
To simply open the Wallet app you can use the wallet:// deeplnk, I'm also trying to figure out how to open specific passes.
We use an LMS calles Canvas by instructure. Our students access the LMS via the iOS app, however we would like to be able to call out from this app to another app (e-book reader).
We just want to be able to select a link which will redirect us to the app.
We have a coder in our staff, and we would really appreciate any advise on how to achieve the above.
You can communicate with URL Schemes between apps Apple Inter-App Communication
And here is Tutorial explaining URL Schemes implementation.
If you have access to the e-book reader app's codebase, this is simple to achieve by specifying a URL Scheme this app may respond to (or, alternatively, if you happen to know what URL Schemes this app supports). Then it will be as simple as calling out a URL of a corresponding format from within the iOS app your students use.
Alternatively, if your app provides access to the documents of some sort, you could look into UIDocumentInteractionController that can add "Open in..." functionality to your app, allowing app users to open a document in an arbitrary app that supports this file format.
I'm currently working on a Apple Watch app and I'm facing a problem.
Since the app company I'm working on doesn't have a API, and is not planning to make, I use a UIWebView to parse some HTML into the app.
I'm trying to port this to the Apple Watch, but I cannot open a UIWebView in background using the handleWatchKitExtensionRequest delegate.
Is there any way to run a UIWebView background task and send some data from it to the Apple Watch app?
I'm not aware of any method to run a UIWebView in the background. I think you'll have to use something like NSURLSession to download your HTML. Hopefully, you can reuse your parsing logic as-is.
I can not use
UIApplication.sharedApplication().beginIgnoringInteractionEvents()
in WatchKit Extension, I have error:
'sharedApplication()' is unavailable: Use view controller based solutions where appropriate instead.
Is there some alternative ?
The short answer is: No there isn't.
The long answer:
Please keep in mind that the extension is not executed on the watch but on your phone. So if you would call UIApplication.sharedApplication() it would return you the application of the extension on your phone, anyway! Everything you do inside your extension is stuff that manipulates the extension on your phone. The only exception from this are the WatchKit methods. And even they are basically calls that are converted into instructions that are send over bluetooth to tell the watch what to do. At no time you can write code that executes on the watch!
You have no control what so ever about what the watch does with the instructions you send to it. You are basically acting as a server talking to a client and you have no control over the client. You should send as little instructions as possible and once you send them, your task is done, the rest is up to the watch.
That being said, you should carefully plan your UI in a way that you do not need any calls that manipulate the event delivery. You should focus on simple 'if user taps x I do y' interaction.
Another thing to keep in mind is, that your extension can not communicate with your main iOS app. You can create a shared app group between your iOS app and your watch extension to share data between them, however you can not directly communicate with your app. If you want to use parts of your apps logic, extract the module in question into a framework (this has become very easy with Xcode 6) and use the framework in both, your app and your extension.
How do you import or display an application inside another application?
It is like, it will be a part of the app where you can use it's functionalities. Maybe in full screen or not in full screen. My thoughts are these are web based and is being opened in a UIWebView to use the functionalities.
Extensions? It's more like "piggybacking".
Here's an example:
https://hub.united.com/en-us/news/web/pages/uber-on-the-united-app.aspx
I'll post an answer regrouping my answer and also #Popeye one that seems valid too.
There may be a few ways to do it, each ones of them may act differently.
The other app offers a public SDK/API/WebServices
As an example, I'll take FaceBook API, that allow you to login giving you a UIViewController (that you can customise), and allowing you to ask for some data through their WebServices (like who are the friends, etc.). You're still inside your app.
The other app offers you a private SDK/API/WebServices
Same as the other one, but it more like a parternship. You're still inside your app.
URL Schemes
The other app gives you a few way to interact with it. They check if the app is installed, and launch it with some parameters, or if not, they may redirect it to the app in the Store, their website, etc. More info about URL Schemes from Apple Doc. You have to check their documentaion to know how to interact with it.