Check if Phonegap app is running on iPad or iPhone - iphone

I would like to check inside my javascript file if I am running on an iPad or an iPhone. My app was using previously the device.platform method of Phonegap 1.9 which was retrieving "iPhone" or "iPad". I am now upgrading the app to Phonegap 3.0 and this same method retrieves "iOS".
Is there a clean method to retrieve the platform?

can you use device.name method

Related

How to get app url in Marmalade 6.3 like HandleOpenURL in Objective c?

We have a Game app developed in Marmalade 6.3 version.
We got Xcode build for that using Mkb file and able to deploy it successfully on iPhone.
We are launching this Game app from one another app developed in Xcode, and append some text like credentials in url as well. But not finding any way to get App URL in marmalade generated Xcode project in game app.
Is there any way to get this?
We have tried S3eEDK but it's importing UIKIT framework and that is not supported in game app as it's Developed using Mac OSX.
Thanks & Regards..
As the game is developed in macOSX we are not having even appdelegate class in our app. And having appkit in place of UIkit but once we add that to our app it gives error no such file or directory....

AdSupport framework not added in ios5 with xcode 4.2

Im integrating FacebookSDK in my app with ios6 and Xcode4.5 .But when I run the app in prevoius versions of XCode (Xcode 4.2 with ios5) I couldn't be able to link Social.Framework and AdSupport.Framework .They are missing and I couldn't find it under Build Phases.Gone through Google and found they are not present in ios5.But when I make those Frameworks as optional .I have made them as optional.But that doesnot work for me .And I couldnot find any turnaround solution to this.
How can I get it worked in xcode4.2
iOS started supporting Facebook API which is Social.Framework is included in iOS 6. It's not available in earlier version for Facebook. You won't get a framework for iOS facebook api in XCode 4.2.
EDIT :
In this case what you have to do is, keep the framework optional which you have already done. Check if Facebook class exists before you call the function. If it does that means user is using iOS 6 or greater version then iOS 6. If it doesn't means user is using iOS version less then iOS 6. To give the reverse compatibility you'll have to implement the Facebook API.

Releasing iPad app, after iPhone App is in the store

I have developed an iPhone app and preparing to upload it to iTunes store.Later on I want the iPad version of the app as well which I am currently working on.
So I would like to know whether it is possible to release the iPad app later as an update to the existing app in the store?
So long as the iPad version is part of a universal bundle (iPhone and iPad resources in the same app) it would be treated as an update.
I don't believe you can. However, I think that you may be able to update it to a Universal application.
Most people just make the iPad version separate and call it App HD or provide universal versions.
Yes. You can make it Universal with an update, but you can't stop support a device after you published a universal app!
If you want to upload a different iPad-Version (e.g. AppXY HD) you can also create this in the same Xcode project and upload them as different versions.

How to create an iPhone application?

I want to create an iPhone application. But the build should work for iPhone device 3.0 to 4.0.
Please give me some idea for that. Because, I have created an iPhone application. I have installed that application in a device (version 3.1.3), it is working fine. I have tried in iPhone version 4.0 with the same build. But I am getting some error message.
error message:
"entitlements are not valid".
There are two settings that you should look at (in your project's info on the build tab):
1) Base SDK - this is the SDK that you are going to link your app with - set this as high as you can.
2) iOS Deployment Target - set this to be iOS 3.0
The first one is the one used by the compiler to make your app.
The second one controls which devices your app can run on (iOS 3.0 means 3.0 and anything above that)
Watch out though - if you use any methods that are only available in iOS 4.0 the app will compile fine but will crash if you run it on a 3.x device - you need to thoroughly test it just to be on the safe side. If you look in the docs each method says which version of iOS it's available on.

iPhone app compiled in XCode with a private framework doesn't work in iPhone

I'm writing an iPhone app that needs direct access to the camera. Since it is in-house, I have no qualms about using the full set of headers and private frameworks.
I included and the PhotoLibrary framework in the application. It compiles for the 2.0 firmware, and I can put it on the device and run it. As soon as it is started, however, it quits and returns to the home screen.
I think that the PhotoLibrary framework is somehow not being loaded or something similar.
I would post some debugging output, but I don't actually have the phone yet.
Thanks!
That might or might not be the problem. The iPhone simulator lets you get away with a lot of stuff that doesn't work on an actual device-- there's any number of classes that a simulator app can use that don't exist on the phone (e.g. NSXMLDocument, available on Mac OS X and iPhone simulator but not actual iPhones). Get the phone, run the app, and use Xcode to look at the phone's system console to see why it's crashing.
Thanks for all the help.
It turns out that I was trying to use classes from the iPhone 2.0 SDK with an iPhone that has 2.2.1. Thus, it would compile correctly when I set the device to 2.0 in Xcode, but would fail on the iPhone because the old classes were no longer there.
I fixed my problem by getting the classes from the 2.2.1 SDK. Now my program runs fine on the iPhone.