Disable/Enable Cordova Plugin based on feature flags - ios

So I want to enable/disable a plugin in cordova based on feature flag that values are stored in localstorage.
Application is an angular-cordova hybrid ios app.
flag values.
Currently I am manually commenting out code inside .m files pluginInitialize() method. Is it possible to do that using if and reading localstorage

Related

How to use iOS keychain in Oracle MAF application?

I am pretty new to Oracle MAF framework. I want to store a string to iOS keychain and retrieve later. I have searched for a tutorial and still unable to find.
Please share any tutorial if anyone has done this before. Also I want to know whether we can use a Cordova plugin such as https://www.npmjs.com/package/cordova-plugin-ios-keychain directly in the MAF project?
I was able to resolve the problem. I would like to share how did I manage to do. Cordova plugin can be used in the MAF application. MAF app's java code can invoke javascript methods in the cordova plugin. Or we can write a javascript class to do the bridging between MAF app and the cordova plugin.
This is a good tutorial for your reference.
https://blogs.oracle.com/mobile/integrating-a-custom-cordova-plugin-into-a-maf-app

iOS Firebase IS_ADS_ENABLED flag in GoogleService-Info.plist file

When adding Firebase support to the iOS app, Firebase generates this GoogleService-Info.plist file.
One of the flags in this file is IS_ADS_ENABLED which defaults to true.
I can't find any documentation of this flag (on the website nor in FIROptions). Does anyone knows what does it do and when can I disable it?
Firebase support gives this answer about IS_ADS_ENABLED
The IS_ADS_ENABLED key was previously used on Firebase projects that
are using Google Ads features. However, it's deprecated now, but your
app should have no issues whether it's set to true or false.
We're still looking for solutions to remove this for all projects to avoid confusion. As of now, we are yet to find out any details or timelines as to when it will be implemented
Yes, you can disable it. I have disabled it in my project.

Transfer LocalStorage When Installing cordova-plugin-wkwebview-engine Plugin

Is there a way to transfer a user's LocalStorage data to the wkwebview browser when adding the cordova-plugin-wkwebview-engine plugin into an existing cordova/ionic project?
WKWebView is essentially a different browser and has no knowledge of any previous data saved within the UIWebView browser.
Crosswalk for Android handles this process automatically by migrating data to the new browser when the plugin is installed and first run on an existing user's device.
This Cordova plugin seems to be doing exactly what you describe, it migrates the localStorage from UIWebView over to be used in WKWebview: https://github.com/MaKleSoft/cordova-plugin-migrate-localstorage
Someone even forked it to add more functionality, such as migrating IndexedDB: https://github.com/jairemix/cordova-plugin-migrate-localstorage
Hope this helps!

Cordova iOS application preferences plugin caching issue

I'm using this handy Cordova plugin to set application settings from the homepage of my Cordova iOS hybrid app:
https://github.com/escio/cordova-ios-application-preferences
I have a local hybrid app and from the index.html homepage, and I set an application preference when a user clicks a button, using this plugin.
On success of setting the application preference, I have confirmed via logging that the setting is correctly set. At that point, I call a JS function that looks at the application preferences. What's weird is that although the log indicates that I've set the preference correctly, my JS function is still using/referring to the default value for that preference. If I exit the app and restart it immediately, it's clearly working with the newer application preference but on that initial flow, the app appears to be using a cached version of the application preference.
Any ideas here? How can I get Cordova to use the current application preference?
To close the loop on this, I discovered that although the plugin was setting the value, the hybrid app had a bunch of native code running and the settings values were grabbed by the app at initialization. So in addition to setting the new value in the Application Preferences, I had to add a small method call into the plugin, in objective-c, to set the new value on the native side of the application memory/state.

PhoneGap application requires native iOS code for background service?

I have a PhoneGap app and it checks your location every 5 minutes and reports it back etc.. to do this When the app needs to run in put at the background .
For Android I have written native code but for iOS will this work?
I'm not even sure how you would implement native objective c into PhoneGap as they are very different compilers etcthe it pause.
Any advice would be appreciatedWhen it come back to front, it will resume all remaining operation.
You need to write a Plugin to do this. A plugin will allow you to write Objective-C code and link it back to a JS function. Here are a few tutorials:
From Apache
From Adobe
Another
Here is also a big list of Plugins people have already created: iOS Plugins

Resources