I would required to implement the OSX application online/offline mode.
When internet is available the app icon should online() otherwise the icon should change to offline().
I have implemented checking the internet connection availability(Refered Reachability sample code) but i don't have idea about how to implement online/offline mode like continuously checking the internet connection and update the icons.
Please guide how to achieve the functionality.
Related
I have an app, in which the user can initiate a short, asynchronous download to access data on the internet, and then the app displays that data. The app is not yet released, but I have tested it on both simulator and several physical devices. On none of them, however, I can locate the app inside the settings menu where I could, for instance, restrict its network access to WiFi only, etc.
I assumed that if my app accesses the internet, it would automatically appear in the settings menu, but apparently it is not so. Am I doing something wrong? What is the process to allow the user to access such basic settings?
I use XCode 10.3, and probram in Objective-C.
If the problem is that there's not a settings entry for your app, please keep in mind that sometimes, in order for an app to be registered, you may need to close your app and the settings app and try opening it again.
If the problem is that you don't see the standard settings for location services, cellular data etc, then you may find maddy's answer here to be helpful: Why is my iOS app forcing a Settings Bundle might be helpful.
Copying the relevant part from this answer:
The iOS 8+ settings page appears […] if the app does any of the
following:
Attempts to access data via a cellular network
Various privacy data
Camera
Microphone
Photo library
Contacts
Location
Notifications
Background data fetch
A settings page may not appear for an app if none of these conditions
have yet been met.
I'm using worklight application management features from an Android native App.
I want that when in the console the application status is changed to "Access Disabled" the only option for the user will be to quit.
In the Knowledge Center and in Developer works there is documentation about how to do it:
http://www-01.ibm.com/support/knowledgecenter/SSZH4A_6.2.0/com.ibm.worklight.appadmin.doc/admin/t_denying_access_to_older_app_versions.html?lang=en
https://www.ibm.com/developerworks/community/blogs/worklight/entry/how_to_create_a_customized_remote_disable_behavior?lang=en
It is explained that you must set a specific value for the initOptions object used in the WL.Client.init() method.
But in the Android native API I have not found the way to set the initOptions. The init method is deprecated and it does not accept initOptions.
Also, in case of Remote Disable the ResponseListener used in the WLClient.connect(aResponseListener) is not invoked, success or failure, no method is executed. Is this working as designed? I would expect a failure or success but not nothing.
Is it possible in a native app to force the application to close in case of Remote Disable?
How could I handle this situation manually in the app?
Unfortunately I do not have an example for you, but this is the general idea.
See if you can work with it (if someone can produce an example - please do...):
You need to create your own Remote Disable challenge handler that will extend the default Worklight Remote Disable challenge handler (RemoteDisableChallengeHandler.java).
class MyRemoteDisableChallengeHandler extends WLRemoteDisableChallengeHandler
Then you need to implement your custom logic in MyRemoteDisableChallengeHandler
WLClient.registerChallengeHander(new MyRemoteDisableChallengeHandler())
This will override the original.
You'll need to create your own dialog with a Quit button.
Some additional documentation.
For handling MaM configurations, this is, when you configure the app as Lost, Stolen, etc, in the Worklight Console -> Devices tab you must install the Fix IF201408281937 (Worklight 6.2) or later.
This events are also handled with the ChallengeHandler registered for the realm "wl_remoteDisableRealm"
I am working in an application that detects any Beacons nearby and gives and alert in the form of local notifications for iOS. I used TiBeacons library for titanium which did the work but I am right now stuck with an issue where I need to keep the Application running even when the user swipes off the application from background.
I was able to make it work in background which is the paused state,but is it possible to make it restart itself in the background when the user swipes the app from the background processes running,maybe with a delay if not promptly?? Thanks
There is no way to restart application after user removed it from a memory. This would be huge security bridge allowing developers to do lots of evil things to customers' devices.
You can run your code only when app is in foreground and background but never when it's killed.
You can try activate your app by receiving notification from Apple Notification Center Service:
The purpose of the Apple Notification Center Service (ANCS) is to give Bluetooth accessories (that connect to iOS devices through a Bluetooth low-energy link) a simple and convenient way to access many kinds of notifications that are generated on iOS devices.
The ability to detect iBeacons after the app was killed in the task switcher was only added in iOS 7.1. Also, I believe this functionality requires that beacon monitoring be set up with the app's main AppDelegate object as the CoreLocation delegate. I do not know much about Titanium, but glancing at the source, it appears it does not do this, and instead uses a different class as the CoreLocation delegate. This may explain why this does not work for you.
If my suspicion is true, you would not be able to detect after the app is killed using an unmodified version of that library.
Since I am not a Titanium expert, it would be best if someone who knows more about it could confirm or refute my suspicion.
I'm testing a feature
that when I can't get wifi connection
I will show a alert view and a button to go to system wifi setting
I know that in IOS6.0 this can't be done
but today I downloaded google map with my Iphone 5(IOS 7.0.6)
If I didn't have Wifi and 3g it will pop out a view
and if I press setting I can go to wifi setting
So I think this feature can be done in IOS 7
Can anyone tell me how to do this??
And Sorry about my poor English!!
No this is not possible, the dialog you are seeing is system dialog saying that if you turn on WiFi you will get a better location fix. As a developer you have no control over these dialogs.
I'm a newbie in using appcelerator titanium, and I'm using this platform to create an alarm application. But I'm facing with a problem. I don't know how I can open an application's window at a fixed moment of time (even when my application is closed, and the device is sleeping). Have any features as Alarm and BroadcastReceiver as in Android OS? Please help me, thanks!
On which alarms do yo want to respond?
On iOS you can't wait for such events when your app is in background in general and you can't listen for them with titanium. With Titanium you can use LocalNotification (working like a timer). In their callback you should set a property and when the user opens your app you should check this property and open your window.
On Android you may create a background service but i have no idea how to listen on native events (except battery) on android.
Thanks for your reply.
I'm finding for a mechanism that has ability to wake up the device when it is sleeping and then open a window in my application. In Android, I know a mechanism called Alarm, I can register an Alarm with the Android OS, and after a specified moment of time (specified when I register Alarm), Android OS would be wake up the device (if it is sleeping) and send an Intend. And then, in my application I can register a BroadcastReceiver that listen for that Intent sent by Android OS. In that BroadcastReceiver, I can do something like start services, open new window (known as Activity in Android).