Cordova Plugin to be used in Worklight, for geofencing in Background even if the app is suspended/terminated and also when the phone restarts - background

I have been investigating in this feature for a long time. All I can find is a pure iOS native code that checks for the key "UIApplicationLaunchOptionsLocationKey" from the LaunchOptions, if it is found it calls the LocationManager to start it and keep on listening to the location updates.
You can find this code in this github:
https://github.com/voyage11/GettingLocationWhenSuspended
I need the same concept, but with a way to integrate it in Worklight, through cordova plugin or something. As I'm already creating the geofencing triggers using the hybrid Worklight APIs, I need to keep the geofencing alive even when the app is suspended/terminated and also if the phone is restarted.
Please I need you support urgently. Thanks

Worklight provides the ability to create Cordova plug-ins.
You could implementing your own native code then, mimicking that from the Xcode project you've found on GitHub.
Read more here: Adding native functionality to hybrid applications

Related

Adding react-native-windows support for an existing React Native project

We have an ongoing React Native mobile development project targeting Android and iOS. Now a requirement has come to use the app under Windows environment. There is not much information on the web we could found on this.
If we can get some insight on the complexity, pitfalls and challenges in adding windows platform for an already existing React Native project, that will be immensely helpful.
We are using Hermes and we understand the support is still experimental
Realm support is not clear. Realm has support for UWP but is it in a stage where we can use in production level?
How much support is available under windows for other 3rd party libraries
How much code will be able to share between platforms. Will we have to write lot of native level code?
Would react-native-web be more safe bet, if that is an acceptable option for our customer
So far we went through the documents available on web such as
https://learn.microsoft.com/en-us/windows/dev-environment/javascript/react-native-for-windows
https://microsoft.github.io/react-native-windows/docs/hermes
https://github.com/realm/realm-js/issues/432
https://www.mongodb.com/docs/realm/sdk/dotnet/#std-label-dotnet_supported-platforms
However, have to provide a time estimate and cost benefit analysis before actually implementing it. Thats why we would like to get some insigth from someone who has already done it.

React Native CLI Setup for both IOS and android

I am trying to start a react native project using the React Native CLI method (https://reactnative.dev/docs/environment-setup). My first question is, if I have a mac and my friend has a windows computer can we both work on the same app? Also, how do I configure one single code base for both ios and android? Do I just follow the installation instructions for both in a single project? Thanks!
Yes, you can work separately on windows and mac for the same app and you don't have to configure any kind of codebase as react native is hybrid app development technology, you just have to write a single code for both the android and ios platforms.
To install react native CLI just follow the official document on your specific platforms because both of them have a slight difference in the installation process, after successful installation, I would suggest you to use some kind of VCS(Version controlling system) like git or svn.
I am also working in the same process as you have described I am developing in windows and my friend is working on the mac.
feel free to contact me I will help you if you have any kind of queries

ReferenceError: cordova is not defined in MobileFirst

I am developing Chat application push notification using PubNub. I used pushnotification.js file in my Mobilefirst project as per the direction from
https://www.pubnub.com/blog/2014-12-18-sending-android-push-notifications-via-gcm-javascript-using-phonegap/
But i am getting the "ReferenceError: cordova is not defined" . How can i solve this issue in my MobileFirst Project?
Please suggest
You are not explaining at all(!) the steps you have taken in order to set this up. I am not sure what kind of support you're actually looking for with such a question.
What I Can recommend you to do is to NOT use a Hybrid app for this. Instead, assuming you're using MobileFirst Platform Foundation 7.1, you can use the "pure" Cordova application type (instead of "hybrid" from MobileFirst Studio). With this application type you will be able to more easily follow the instructions provided in that page.
This is because plug-man is not supported by Hybrid apps to install Cordova plug-ins, making it very difficult to get things working.
So go ahead and follow this tutorial first: https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-7-1/foundation/hello-world/integrating-mfpf-sdk-in-cordova-applications/

How to detect a MobileFirst iOS app's new version in app store and direct updating programatically?

We would like to make a version checking function by clicking a version checking button inside our MobileFirst app. So how to do a detecting of new version of a MobileFirst iOS app for both appstore version and DirectUpdate version.
For direct updating, it's easy to trigger when client is first loaded (now it works great in our initOptions.js file). But also it seems that wl_directUpdateChallengeHandler.handleDirectUpdate works only when the app is loaded. To trigger it, we have to quit the app and re-initialise it. Can we do it programatically anywhere/anytime within app?
And for appstore version update checking (in fact, this won't be frequent), there are many native ways but is there a hybrid or MobileFirst way to do it ?
For the App Store version check you can implement a Cordova plug-in: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/7.0/adding-native-functionality/
For Direct Update, you cannot change its mode during runtime. You can however change its mode to perRequest in authenticationConfig.xml: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/7.0/advanced-client-side-development/using-direct-update-quickly-update-application/

How to run a timer in the Background

I wanna create a mobile apps using IBM MobileFirst Platform Foundation. The app should have a timer, and when I close the application, timer still running. So if the apps has not been used for long time, it will uninstall itself. I hope can get a draft idea how to make it, now I cannot find any material about it (API or others....). Thanks in advance.
It is not possible in MobileFirst Platform Foundation, and in general, to have an application uninstall itself. At the very least you could write a service in Android to do the timer, but not in iOS (maybe only in iOS 8 with app extensions), but still - your scenario is not valid. An application cannot uninstall itself.