3

I am having trouble using third party cordova plugin in Ionic 2 project some of which are not available in Ionic Native. As far as I am concern, the plugins which are outside of Ionic Native, I dont need to import them. They are available directly.

I am using ibm-mfp-core (https://www.npmjs.com/package/ibm-mfp-core) plugin. All I want to use BMSClient.initialize() method to initialize IBM Bluemix SDK. Plus there are some other built-in. But none of them are available in cordova.plugins.

Here's the snippet :

import { Component } from '@angular/core';
import { Platform, ionicBootstrap } from 'ionic-angular';
import { StatusBar } from 'ionic-native';
import { TabsPage } from './pages/tabs/tabs';

declare let cordova:any;

@Component({
  template: '<ion-nav [root]="rootPage"></ion-nav>'
})
export class MyApp {

  public rootPage: any;

  constructor(private platform: Platform) {
    this.rootPage = TabsPage;

    platform.ready().then(() => {
      // Okay, so the platform is ready and our plugins are available.
      // Here you can do any higher level native things you might need.
      StatusBar.styleDefault();

      // initialize IBM BLuemix SDK
      //BMSClient.initialize("https://pearl.mybluemix.net", "1a1ab2e9-4f5a-4db6-9ba3-2da97349a160");

      typeof cordova.plugins.MFPCore != 'undefined'?alert('MFP found'):alert('MFP NOT found');
    });
  }
}

ionicBootstrap(MyApp);
ralphearle
  • 1,696
  • 13
  • 18
somnathbm
  • 649
  • 1
  • 9
  • 19

1 Answers1

0

Have you seen these resources? They are a bit older, but still might be able to help you solve your issues:

https://developer.ibm.com/bluemix/2016/01/20/bluemix-mobile-client-access-services-in-ionic-apps/

https://www.youtube.com/watch?v=UObmJQtxixs

Let me know if those don't help.

Update

As of today a new bms-core plugin has been released. We have been working to improve the cordova experience by completely re-hauling our cordova plugins.

@somnathbm Try playing around with the updated plugin and see if you still run into the same problems.

Dave Cariello
  • 505
  • 6
  • 12
  • Thanks for reply Dave. Unfortunately those resources you pointed above didn't help me. Those are grossly outdated and doesn't work. I've checked the plugin's `plugin.xml` file. Found that the plugin doesn't bound to `cordova.plugins` collection. So it should have been accessible directly. But its not. – somnathbm Sep 16 '16 at 17:26