I'm developing a mobile app and need to know whether or not a home indicator is present on the device I am on (in ios cases). I know that it exists on iPhone X and higher versions. But I can't find out an official list of devices implementing that new feature. Is there one?
That way, I could adapt my UI design according to wether or not the device I detect belongs to that list. (using com.diamonddevgroup.device.Device API)
Just in case, I'm developping using codenameone.
Thanks
I added support for handling that.
Once the update has been approved by Codename One team, update your Device library and call below:
boolean isNotch = Device.isNotch();
You can check the GitHub page for the library here.
And you can follow the status of the library update approval with this pull request. It is approved once its status has changed to Closed.
Leave a comment on this answer or create an issue here if you encounter any problem with the library.
You should definitely be using the safe areas with auto layout to properly layout your views.
But in the case you want to do device specific work, this library is fantastic for knowing about your user's current device.
Related
I have developed project using worklight 6.1.0 and using jquery-mobile 1.4.2 for UI Related stuff.
I have also implemented the worklight skins and the changes are reflecting properly. But I have two queries related to it as below :
1) What is the correct condition to determine whether it is a “Mobile Phone” or a “Tablet” in getSkinName() function inside “skinLoader.js”.
2) When I install the app on the tablet I see that the UI screens do not load properly and sometimes blank screens are shown and sometimes loading icon is displayed continuously on the display. But if I run the same app on the device I don’t face any such issues. Please find attached screenshots for the same error.
Cannot provide source code for the same. Since its confidential.
Attaching the screen shot for the same.
Because Android is highly fragmented - many different devices and many different resolutions, it is more difficult than with iOS.
I can think of 2 options:
have a minimum resolution that you decide to support in your app and check for it.
This will involves additionally also blocking in the Google Play console to any differences that do not correspond to this size preference.
Use the Cordova device API to retrieve the device's model and verify it is a model that you support. If you support it, show the tablet design, if not - display an alert and close the app or show some placeholder page, etc...
As for the second question, this requires debugging. Without code, this cannot be answered. Either provide code, or submit this specific question as a PMR to IBM and remove it from this Stack Overflow question.
In my iOS app I need either prevent the screenshot capture (by pressing combination of Home +Power button), or need to detect before it saved to the Photo library .
In previous iOS version before taking screenshot touchesCancelled:withEvent this method will called , but iOS7 onwards this wont work.
Apple provide a notification
UIApplicationUserDidTakeScreenshotNotification
for detecting screenshot capture .The real problem is this will fire only after the screenshot is saved in Photo library .
Is there any methods (Private /Public) for detecting screenshot before it happens , or Just prevent the screenshot feature .
Dont consider it as a duplicate question , it is iOS7 specific question
No, nothing has changed since iOS7 and it will not change in the future, it is a conceptual issue, iOS app doesn't has control over the device public functions, consider you turned off 'taking screenshot' while other application needs it!! How this app would know about that?
Best thing you can do is using Configuration Profile as mentioned #QED valid answer.
You can restrict with a Configuration Profile, as described in the linked question.
Check out the Restrictions Payload section, starting on page 27, of the iPhone Configuration Proifile Reference. The key you want is allowScreenShot, described at the bottom of page 30.
Also, the linked reference states that there are a number of ways to install a profile. It may be possible for you to provide, within the app, some method for the user to trigger your server to install/reinstall your profile. Just a thought, I'm not experienced in the matter.
I'm not able to speak to private APIs. You might check out http://www.modmyi.com, or snoop around on IRC for some jailbreak communities. There are lots of experts out there who may be able to point you to the API, but they don't tend to hang on SO.
Good luck!
Note : I don't want to submit this app to app store.
What i want to achieve :
I want simple app with one view having two button Lock and Unlock.
Lock - This button will lock device. Only this app's screen will show nothing else will be accessible even after restart same screen will show up. Home button, gestures will get disabled similar to single app mode.
Unlock - This will unlock device and switch to normal behaviour of device.
iOS :
I want this for iOS 4.3 and above.
I have checked following solutions, but these don't match my requirements
Configuration profile
Lock-down iPhone/iPod/iPad so it can only run one app
But it is manual (reboot device, open app which you want to run in single app mode). I want to do it programmatically the way i mentioned above through my app.
Guided access (iOS 6 and above)
How to lock down user to Single App mode in iOS 6, Programmatically?
I want it do for all os and programatically.
Is there any way to do this ? As i don't wan't to submit it to app store is there any private api, some hack for springboard to achieve this ?
Thanks in advance !!
As I know in iOS 7 there is a new feature which allow to do exactly what you want.
However, it's only applicable for iOS 7 (and I believe it's only applicable to a supervised devices).
1) You will need to install restriction configuration profile with autonomousSingleAppModePermittedAppIDs key (take a look here)
This is one time step and a user will need to manually accept this configuration profile.
There is another option to use MDM to install it silently, but it could be an overkill for you.
2) You should use API:
UIAccessibilityRequestGuidedAccessSession (to lock/unlock)
It is defined here
3) And most beautility part. All of it is officially document. So, you can even submit it to AppStore.
P.S. Why do you care about 4.3 or 5? They have tiny market share by now. Most likely even iOS 6 has below 20% market share already.
Update 1
Potentially, you can try to use API which sends clicks and keys (search for GSEvent in iPhone-privateapi tag). May be using these API's you can do triple home to toggle accessibility on and off.
If this work, I think you should be able to cover iOS 6. I am not sure whether both this API and triple home click were available prior that.
It looks like this private API is unaccessible anymore in iOS 7. So, probably you can ignore this idea.
Just wanted to write on this even though this is old as i needed to implement a similar solution and i got it working. The steps for me as follows and a note here is that this involves MDM and other specific steps.
My requirement was as follows. Each of the iPad at different locations has a set of apps installed.For ease of it lets assume each Dept. has their own apps. Participants open a app related to their dept. to take a test, the APP automatically Locks the iPad to single-app Mode and at the end of the test, it will unlock it self.
Supervise the iPad/iphone using the Apple Configurator.
Install the MDM related files ( Each MDM has its own set of instructions, usually involves downloading a profile).
Every MDM has a option of Single APP Mode or MultipleAppMode. Select the second option and add the app IDs to the list. (A single APP mode works pretty well with MDM's but i did not want the app to be locked to a single APP all the time).
I used the UIAccessibilityRequestGuidedAccessSession api to lock unlock the device from single app mode.
http://bobxcode.blogspot.com/2015/12/programmatically-implement-single-app.html
Thanks,
Bob
In MDM configuration, There is an option
autonomousSingleAppModePermittedAppIDs
Optional. Supervised only. If present, allows apps
identified by the bundle IDs listed in the array to
autonomously enter Single App Mode.
Availability: Available only in iOS 7.0 and later.
But this needs Supervised Device mode.
I found this and the problem is that the answers on that question didn't pan out (I also tested them first) and also that it is over a year old.
I've used the solution here to fetch the list of all running processes, but not of the struct kinfo_proc attributes seem to give any useful in detecting which app is currently visible to the user.
Basically:
I am trying to find out which app is currently visible (and open) to the user on iOS devices.
It must work on stock devices (non-jailbroken) and no need to worry about the app store.
Edit: I am looking at the private APIs now, but cannot seem to determine how my app could be notified (or inquire) about a new application being brought to the front.
Thank you
Thanks to #JohnWoods in the comment section of the question, I was able to find the solution on a related question.
The solution I used and that worked for me was here.
I'm developing a business app for iOS which will be used by customers in a cafeteria for ordering various products available.
Whenever iPad is screen unlocked by the customer, the custom business app should open up even if the previous customer open a different app.
So basically open this business app after every screen unlock, is it possible to get this done and how?
no it's no. it's the default iOS behavior. Only in a jailbroken iPad you'll manage to do this.
Definitely not.Its not possible and the other thing if you do so user gets irritated by seeing it again and again..As per my knowledge its not possible as well as not a better idea to do it..Think from user perspective..
I think it's not possible to do, not possible to do that scenario