I am on a Cordova based IoT project. I'm using Ionic 2 framework (Typescript).
And precisely the problem is : I'm having problem connecting the mobile app to the IBM IoT platform.
:: On the front-end ::
I have the Browserified version of the mobile app code (app.bundle.js
).
:: On the back end ::
I have the server.js
file according to the generic structure of a Loopback application.
Here's the problem I'm currently having :
IBM IoTf is a nodeJS library. But it has a Browserified bundled version (
iotf-client.bundle.js
). And the app has also a Browserified bundled version (app.bundle.js
). If I use both the bundled version in my app build process, only one of the functionalities - either app or IBM IoT works; but not the both. Because IBMIoTF is not getting available to window global object.The app backend (
server.js
) is not connected to the Bluemix. If I try to connect & initialize it to the Bluemix platform by using ibmbluemix nodeJS package (which is deprecated as of now), then the mobile front-end is getting not connected to the Bluemix platform. So, I can deduce that I cannot connect & initialize the Bluemix SDK from both mobile front-end & back-end.In this situation, how I'm supposed to communicate from mobile app to mobile back-end to connect to IBM IoT platform? Is it using simple GET / POST HTTP request? If yes, then I have also tried to send a HTTP POST request from Ionic (which is bundled in app.bundled.js) to mobile backend (server.js). But nothing is happening.
PS : I already have installed cordova-whitelist
plugin
Here's the project URL :