ReferenceError: cordova is not defined in MobileFirst - ibm-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/

Related

Expo integration with Google Sign In

I am trying to add login via Google account to my application. I have encountered a problem. Expo offers two solutions.
Google (https://docs.expo.dev/versions/latest/sdk/google/) - This can only be used in a development environment. I have used it but it does not work in a standalone application, in my case it throws the error "redirect_uri_mismatch" /
GoogleSignIn (https://docs.expo.dev/versions/latest/sdk/google-sign-in/) - Doesn't work in the emulator so I can't add it to the application because I can't fix potential errors.
My question is what the hell library should I use?
I have already tried expo eject and use Google Sign In from React Native. However I got an error that Expo does not support custom native modules. Help!
Thanks in advance.
Edit: SDK 44 Release
With the release of SDK 44, expo-google-sign-in has now been deprecated in favour of expo-auth-session OR #react-native-google-signin/google-signin packages. If you want to use the latter, you will need to follow the custom development client path.
Pre SDK 44
We've implemented Google-Sign-In using the expo-google-sign-in library. Implementation is easy enough, but you will have to test using a standalone build of your application which is the only slightly annoying piece of the puzzle.
Building a standalone build is now even easier with EAS (not sure if you have an account - but if you don't, I would highly recommend it.)
I've used a GoogleSignIn library, but I also have pro tip for everyone who will implement it.
Instead of building a project every time when you will need to test it, you can build it once and then just use upadate OTA, it's much faster.

IBM MobileFirst 6.3 - Android Fingerprint Authentication

I want to implement finger print authentication in my IBM Mobilefirst 6.3 Hybrid Android application. I saw some examples in cordova -
https://github.com/mjwheatley/cordova-plugin-android-fingerprint-auth
Here How can I add cordova-plugin-android-fingerprint-auth plugin to my application? Is there any better way to implement this feature?
I was able to implement touch id in hybrid iOS application.
https://github.com/EddyVerbruggen/cordova-plugin-touch-id?cm_mc_uid=04136042670715040496130&cm_mc_sid_50200000=1504217038
Need help to implement similar in Android.
Thanks
Mobilefirst 7.0 and prior releases does not support Cordova plug-man to install Cordova plug-ins and Hence you can't add plugins directly to your applications using cordova command line.
You need to follow the manual installation instructions as explained in this blog post to add cordova-plugin-android-fingerprint-auth plugin in your application.

Integrating Unity project into Cordova with mgcrea plugin

I have an Unity 3D project made for Android and I'm trying to port it in IOS. I created a similar project with Apache Cordova but without 3D graphic, and now I found a plugin for Cordova that promise an Unity integration with Cordova (https://github.com/mgcrea/cordova-plugin-unity). I've tried to integrate it, but I haven't understand where I must insert my Unity files into Cordova.
Unfortunately there isn't a working example and there's a lack of detailed explanation, so I would ask if anyone has already tried that plugin and eventually how it works.
Thanks in advance!

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

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

Can the Onsen UI Javascript and CSS frameworks be used with Worklight Hybrid Applications?

Can I use Onsen UI with my Worklight hybrid applications? Specifically, while using the Worklight Studio for development?
Since it seems to be compatible with Cordova and JQuery on the surface it looks like it does.
As Idan said, you'll need to perform some manual work and you cannot use cordova tools. I was able to create a WL hybrid app project, add the references as in their Guide, deploy to WL Server and open the app in the Mobile Browser Simulator. It took 3 minutes.