share data between iOS native app and browser app - ios

I am a rookie iOS developer trying to figure out this. Pardon me if I am asking basic question.
I need to set an unique identifier in the device (iphone or ipad) that can be read by the app (can be browser app or native app). Is this feasible ?
Reason being: the device needs to be uniquely identified. The user might be able to use the installed app or through browser as well.
Thx.

You can create a HTML element containing any amount of content and hide it with CSS. Sometimes I use an 'input' element just for that and read it with javascript. I think you use data-uri also.

Related

Is it possible to prevent an iOS app from being placed on the home screen?

I am developing an iOS app using Xamarin.iOS that should only be triggered by tapping on a URL. Because of this, I would like to prevent the app icon from being placed on the home screen. The reason is, the app will not function properly if they open it from the home screen (it needs some of the data in the URL to load properly). I would prefer to prevent the app from being on the home screen instead of checking whether a link was tapped or not. I know that is possible to do this in Android using the manifest, is this also possible in iOS?
This is not possible whatsoever; the developer has no control as to the placement and visibility of the application, and as such will always be visible on the springboard/home screen.
The best option you have is to show information to the user that explains why opening it from the home screen will not work, if they launch it that way. Most likely though, this will be rejected from the App Store as having no useful purpose. The guidelines are found here (App Store Guidelines), and I think this is what may cause a rejection (emphasis mine):
If your app is not particularly useful, unique, or “app-like,” it doesn’t belong on the App Store.
I'm not finding the documentation I was looking for, but, as far as I know, this is not possible in iOS.
You could maybe have a default url that the app launches with and then use deep linking to launch the app with a custom urls. There are lots of great tutorials on deep linking (launching your app through a url) like
This one or maybe this one

Don't need the App Store to make apps anymore?

I recently found a site that allowed me to bookmark the site and then use it just like an app. There was no url bar, it was indistinguishable from an app you would download on App Store. Is this a new upgrade or technology ?
This is not new technology, I don't remember how long it's been out, but I'm pretty sure at least since iOS 3. It's called a webclip. You can do quite a bit with a webclip but are still limited to functionality provided by JavaScript, so no accessing the flashlight and certain hardware features (although many are being included in the device JS object). Though it is certainly much easier to implement basic app functionality!
+1 to SnoApps and here's a bit more detail about this older detail.
You can specify a webpage to appear like a regular app icon on the iPhone "home" screen (where all the apps appear).
There's more information here under the "Configuring Web Application" section of this Apple Safari Web Content Guide.

Kiosk App in iOS can we provide any identifer to that app to use from URL scheme.

I wanted, to give some identifier to the app that we create like a kiosk mode in iOS.
i.e. We make add to home screen and it has an icon on home page which browse further.
Is there any way, where I can give some identifier Name to that link of app getting created so that we can get that app access from our Native and we can provide URL Scheme for the same.
Thanks.
iOS will not give access of all the url schemas. You can refer this document where the url schemas for selected application is given :
http://wiki.akosma.com/IPhone_URL_Schemes#Phone
It may be that the only way you can achieve what you want to do is to build an app around an iOS UIWebView. You can then include the camera functionality directly in the app, although there can be issues as a UIWebview doesn't handle things like popups that Safari does.

How to create a HTML link to a build.phonegap app?

I have run into several problems with iOS development through phonegap recently, and unusually people around here have been unable to discuss these issues and even together we have (for the first time I have ever seen) not had a single comment or answer for these topics...
See https://stackoverflow.com/questions/14707936/make-a-page-that-redirects-back-to-ios-phonegap-app and iOS broswer data -> Cache & Cookie for Phonegap App / Session?...
However, I have found "solutions" to get around these, but its by no means answers to the issues in question which are still outstanding... just simply doing it a completely different way.
However, despite loosing web-view in phonegap, in an attempt to get around https://stackoverflow.com/questions/14707936/make-a-page-that-redirects-back-to-ios-phonegap-app I now have some issue that are outstanding...
I need to be able to navigate back to my App from the web-system !!!
However, I have no idea how. I have read info on creating URL Schema, but I am not sure if this is even possible through build.phonegap at all... and it seems faily complicated. Does anybody know of a way for iOS safari to do one of two things
Either
Open the app that is running in the background
or
close the current browser tab and navigate back to the app in the background.
The closing tab idea would be good, but not essential
Look forward to everyone thoughts and opinions on this one...
Henry
You can create an url scheme for any application you make yourself.
See tutorial here
It's not as terribly complicated as one would think, and the required objective-c code is minimal.
Once you have done this, you can use your own url scheme to launch your phonegap application from safari with a hyperlink.
This would not close the tab (you could do this with javascript if you wanted to)
but does put safari in the background, and opens your phonegap app.
(whether it is already running in the background or not)
It is even possible to pass data to the app using your url scheme.
It is not currently possible using PhoneGap Build in 2.2 and previous. Potentially a feature top be released in newer versions of Cordova/Phonegap

How to pass data from webpage to iPhone app

I want to password marked in web page to my iPhone application. If I paste it to clipboard then I need to run my app in background which is not possible in iPhone. So, how I should do that?
You can define a Custom URL Scheme in your iPhone app. Then you can link to your iPhone app using a regular HTML link, so for example Click here to go to my app. For more information about this, go to the Apple documentation (scroll to the part about Custom URL schemes). You can also find a lot of information about this by googling.

Resources