Unable to connect to MobileFirst Server 8 beta - ibm-mobilefirst

I am working on ionic with mobilefirst project. While i am trying to integrate ionic App with mobile first, the mobilefirst server is not connecting with my App, in the server console i am not getting any information regarding to my App.
Configuration:
mobilefirst: 8.0.0
cordova: 6.1.1
android: 5.1.1

To first step in order to have the MobileFirst Server recognize your application is to register the application. You can do this in two ways:
Using the MobileFirst CLI
Make sure you have the CLI installed
navigate to the root folder of the application project
Run the command: mfpdev app register
Directly from the MobileFirst Console.
This step will require you to manually enter the details of your application
Load the console, typically localhost:9080/mfpconsole (if running the server locally)
Next to "Applications" in the sidebar navigation click on "New"
Provide the app details:
Name
Platform
bundle ID and version (you can find these in the config.xml file of your application project
The next step is to actually have the application send a request to the server to see if the connection succeeded...
Add the SDK by running the command: cordova plugin add cordova-plugin-mfp
Open the index.js file of your application and add the following code (just an example):
function wlCommonInit() {
WLAuthorizationManager.obtainAccessToken().then(
function () {
alert ("successfully obtained a token from the server");
},
function(response) {
alert("Unable to obtain a token from the server: " + JSON.stringify(response));
}
);
}
Take a look at this Ionic example: https://github.com/csantanapr/mfp8-ionic-demo/blob/master/www/js/app.js
Once the custom "MFP init" has been fired, you can then use the above WLAuthorizationManager API.
If it fails, then you did not properly register your application.
Make sure the version is correct
Make sure the bundle name is correct
Please read through the tutorials: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/all-tutorials/
You can also find Ioic app examples with MFP, here: https://mobilefirstplatform.ibmcloud.com/labs/developers/8.0/intro/

Related

No option for adding New flutter Web Project in IntelliJ Dart Templates !!! Also tried Vs code, is asking for Which Dart template

I'm trying to start a new Flutter project in Intellij as well as Vs code.
Intellij there is no option provided to add a new flutter web project in Dart templates.
Vs code whenever I select New flutter Web Project after accepting the stagehand it asks for the Dart template which is why I'm stuck.??
Please help soon??
Since flutter 1.9 flutter_web is merged inside flutter, Follow the below steps to create and run your first flutter web App through IntelliJ IDEA.
Create a new flutter project.
Now change your flutter channel to master using flutter channel master
Upgrade flutter flutter upgrade
Install the flutter_web build tools flutter pub global activate webdev
Enable flutter web using flutter config --enable-web
Check available devices flutter devices and you will get a result like:
Chrome • chrome • web-javascript • Google Chrome 81.0.4044.92
Web Server • web-server • web-javascript • Flutter Tools
Inside your flutter project create myapp using flutter create myapp
Navigate inside myapp using cd myapp
Finally, run flutter run -d chrome
And you will be able to run your flutter web app into chrome. Hurray 🤟🏽🤟🏽🥳
Reference links: Building a web application with Flutter , flutter_web
It seems that the support for Flutter Web Apps was dropped in stagehand (that contains the dart templates). From this commit on github: (Dropping Flutter Web sample). Instead, this wikipage shows how to migrate/create a web package in flutter from command line.
Create your project from command-line.
Check out this tutorial. flutter.dev/docs/get-started/web
Then just open the project in IntelliJ IDE.
Install or Update the dart and flutter plugins in Intellij and/or VS Code
For Intellij
Go to [mac] Preferences>Plugins>Marketplace and search for Dart and Flutter, install it.
For VS Code
Go to View > Command Pallet and type in Extensions: Install Extensions
then type flutter and install it
Its well documented in this link
Setup Flutter

Error during mfp app webupdate for implementing direct update functionality

I have tried to check direct update provided by ibm mobile first.
after changing the web resources to upload my new application to mfp console
i tried to run: mfpdev app webupdate
console output:
Deploying to server:'http://10.207.135.166:9080' runtime:'mfp'
Error: Web resources could not be deployed for platform: ios
Error: The mfpdev app webupdate command failed: INVALIDPLATFORMVERSION

Calling external URL in inAppBrowser

How can we call external URL inside our worklight hybrid application?
We are calling it through window.open but we want to open it in InAppbrowser.
Does it need to install Cordova plugin "cordova-plugin-inappbrowser" ?
We have MFPF 7.1
can someone please advise what steps we need to follow.
Thanks,
IBM MFP 7.1 has cordova and the major cordova plugins embedded. This means when you create an MFP 7.1 hybrid project, certain plugins are already present for your use directly. The complete list of available plugins can be found in this document : https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/7.1/hello-world/integrating-mfpf-sdk-in-cordova-applications/ .
You will find that among others, inappbrowser is also automatically added to your hybrid project. This means you can directly use :
var ref = cordova.InAppBrowser.open('http://apache.org', '_blank', 'location=yes');
or set existing window.open to inappbrowser like this :
window.open = cordova.InAppBrowser.open;
More usage info on inappbrowser can be found on the official cordova browser over here :
https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-inappbrowser/

'WLAuthorizationManagerPlugin' not found, or is not a CDVPlugin

I have a hybrid app I am building for iOS. It uses Adapter authentication which has been working fine.
I recently updated from MobileFirst Studio 6.3 to 7.0. At the same time, I updated Xcode to version 6.3. My app continues to work fine and authenticates with the backend fine when run through the Browser Simulator, but running on a simulator or real device from Xcode, I get a connection timeout error. The console contains this: ERROR: Plugin 'WLAuthorizationManagerPlugin' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.
I see lots of questions on SO for "plugin not found or is not a CDVPlugin", but since this is a MobileFirst plugin, I wouldn't expect it to suddenly go missing. Could this be fallout from the update?
Is this a sample project from the MFP Developer Center, or an application of your own.
Either way, you can create a new project and add the iPhone environment and compare your project's native\config.xml with the new project's native\config.xml and correct yours accordingly.

I created my first hybrid app on MobileFist, now how to publish it to a real device?

I've just created my brand new - and simple - hybrid app using MobileFirst and JQuery Mobile.
I can preview it on the MobileFirst Console, but now the question is: How to deploy it to a real device?
Is there a way to easily export my hybrid app to and apk file?
There are some mentions about the ApplicationCenter, is it needed to publish my app?
Thanks!
To make a hybrid Android app using MobileFirst Studio you need to follow the steps to setup your Android environment.
https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-7-0/setting-up-your-development-environment/setting-android-development-environment/
After you build your Android environment an Android project will be loaded into your eclipse workspace. To export this project as an .apk simply right click the project in your workspace Android Tools > Export Signed Application Package... and follow the export wizard. Alternatively you can follow the steps on how to export your signed application in http://developer.android.com/tools/publishing/app-signing-eclipse.html