How can I call with native Swift methods from Electron app using javascript? - in-app-purchase

I am looking to add in-app subscriptions to the mac desktop app so I can submit to app store.
I have the code written for iOS using the cordova plugin: https://github.com/AlexDisler/cordova-plugin-inapppurchase
But for electron there exists no such plugin.
So I can use the native swift code from the plugin, but need a way to write a custom plugin so I can call swift methods from javascript running the Electron app.
Please let me know how to approach this, or point me to the correct resources.
Thanks You

Related

Allow user to change App Icon in React Native

Apple specifies that users can change their icon to give a more personalised experience. See docs here:
https://developer.apple.com/design/human-interface-guidelines/ios/icons-and-images/app-icon/#user-selectable-app-icons
My question is regarding using this functionality in React Native. Building an app in React Native is it possible to access this setAlternateIconName method and provide the user with alternate app icons? Does React Native provide a nice way to interact with this IOS method?
I am currently trying to build this out. This package seems designed to do what we both are looking for, but I haven't tried on anything that I have actually deployed yet.
https://github.com/skb1129/react-native-change-icon
use can use this module react-native-alternate-icons, it allows to access to setAlternateIconName method

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

How to open another iOS app from my PhoneGap app?

I have a PhoneGap application, which needs to communicate with an external iOS app on the same device. The external app will do some special processing, and return a unique value back to my PhoneGap app. PhoneGap app then uses this unique value to do some processing internally.
Given this use case, I have two questions
How do I open another iOS app from a PhoneGap app?
How do I return to the PhoneGap app with some data from the external app
I have searched so far, but haven't found very relevant documentation. I have also tried to open another app using appname:/// strategy, hasn't worked for me.
Any help will be appreciated. thank you!
Cordova has wide range of plugins for performing different operations.
For opening external application you can use: https://github.com/lampaa/com.lampa.startapp
If you want to open an application without using any plugin:
var iOS_specificUrl = 'custom_url_scheme://url-to-reach?parameter1=val1';
window.location = iOS_specificUrl;
or you can use inappbrowser
var iOS_specificUrl = 'custom_url_scheme://url-to-reach?parameter1=val1';
window.open(iOS_specificUrl, '_system');
Let's say you have app1 and want to open app2 then you need to assign custom url to app2 and for that you need to make changes in app2 configuration xml file; and to do this you can use following plugin:
https://github.com/EddyVerbruggen/Custom-URL-scheme
Or if you want to open third party application then you need to get in touch with application provider for getting custom url.

Porting native apps to Phonegap?

I have a native app for iOS and am being tasked to create a new app that includes portions/sections of that original native app within this new project. The caveat being that the app I am now tasked to develop must be done with Phonegap/Cordova.
My question is, what options do I have for utilizing the native code within the Phonegap project, or does the same functionality all need to be rewritten in HTML5/JS? I'm new to Phonegap so I don't fully know it's capabilities.
Generally phonegap apps are coded in javascript, css, html and where ever they need access to the native layer, they use phonegap plugins to access the native functionality. If you want use your existing code for integration into a phonegap app, you can do it by wrapping your code using phonegap plugin architecture and create plugins for the functionality from the code that you wish to reuse. Then you call those plugins where ever required in your application.
The below link is good starting point for creating plugins.
http://docs.phonegap.com/en/3.4.0/guide_hybrid_plugins_index.md.html#Plugin%20Development%20Guide

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