Oboe.js not compartible with Ionic

#1

As per the requirement of the enterprise, I had to use oboe.js to capture live responses using HTTP protocols. Therefore, I wrote the below oboe.js which worked fine in the web browser and Android, iOS emulators, but when I tested the same code in the real android device using Ionic, it does not fetch any response.

                      `oboe.get('' + API_URL + '',
                             {	
	                    pattern: '{Value}',
			     headers: {
					'Authorization':  token,
					'Cache-Control': 'no-cache'
				}
				}).node('{Value}', function(power){
				
				}).done(function(power){
					console.log(power.Value);
					$scope.power = power.Value;
			
				}).fail(function(error){
					console.log("Error:", error);
				});

Does oboe.js not compatible with Ionic/Android?

#2

Did you remote debug the problem on the device already? Follow these instructions here to debug the problem in Chrome dev tools: https://ionic.zone/debug/remote-debug-your-app#android Look at the console and network tabs for errors.

#3

Yes, I did. The above oboe.js code does not run on real android device. However, the same code run well in android and iOS emulators.

#4

And you are not getting any errors, just “does not run”? This is almost never true.

Post your ionic info please.
Maybe create a blank project (ionic start oboe blank), implement a minimal example of the call you have and put it on Github so we can reproduce.

#5

Your system information:

Cordova CLI: 6.5.0
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Framework Version: 1.3.3
Ionic CLI Version: 2.1.4
Ionic App Lib Version: 2.1.2
OS: Windows 8.1
Node Version: v7.0.0


Thanks Sujan12, for your quick responses. Will work on the minimal example and provide you the github.

#6

I would advise you to upgrade these to current versions: Cordova 7.0.1 and CLI 3.5. Maybe this is causing your problems.

#7

Updating Ionic and Cordova CLI did not solve my problem.

#8

Post your ionic info again please.

#9

global packages:

@ionic/cli-utils : 1.5.0
Gulp CLI         : CLI version 3.9.1 Local version 3.9.1
Ionic CLI        : 3.5.0

local packages:

@ionic/cli-plugin-gulp   : 1.0.2
@ionic/cli-plugin-ionic1 : 2.0.1
Ionic Framework          : ionic1 1.3.3

System:

Node       : v7.0.0
OS         : Windows 8.1
Xcode      : not installed
ios-deploy : not installed
ios-sim    : not installed
npm        : 3.10.8

E:\Atidivya\VPS\Projects\bcc>cordova -v
7.0.1
E:\Atidivya\VPS\Projects\bcc>

#10

Looks good (although you should update npm if you have the time :wink: ) - next step reproduction project on Github we can look at.

#11

As suggested by you, I again tried to debug my app through chrome inspector with an additional cordova plugin

cordova plugin add cordova-plugin-crosswalk-webview

and it worked!!
my oboe.js is working now :slight_smile:
Thank Sujan12 for the help :slight_smile:

1 Like
#12

Be aware that crosswalk adds a lot of stuff (file size, code) to your app that you might not want. Also it is not really supported any more, so if you can find another solution, this will always be better.

#13

Yep I noticed. Now I am trying to remove this :stuck_out_tongue:

It just added the web app application and it does feel like native app. My app size increased till 40 MB which is worse. :frowning:

Can you tell me any other way to debug my app. When I open remote debugging from the console it gives

LG-E460

No browsers detected.

I followed this video of ionic to debug.

#14

Follow these instructions here to debug the problem in Chrome dev tools: https://ionic.zone/debug/remote-debug-your-app#android

Only works with debug builds, not release builds. Maybe also restart your computer and Android device if you really can’t see it.

#15

I am able to inspect the web browser, not my application. My ionic app does show in the remote debugging list.

How do open developer tools for Ionic application or any other application rather than web browser?

#16

The app should show up there as well.

Try again with a blank app (ionic start blank blank, then ionic cordova run android) if this shows up. It should.

#17

My android version is 4.1.2. Does it needs be more than 4.4 ?

#18

Your cordova-android version (Cordova platform)? Yeah, doesn’t hurt, but shouldn’t be the problem here. Try it - remove the platform and add it back.

#19

Nope. The android OS version my phone where I am testing my ionic application is 4.1.2.

#20

Oh…

Then you need Crosswalk as Android <4.3 doesn’t really have the features needed to run Ionic apps by default. I don’t know if this applies to Ionic v1 as well, but most probably to Oboe.js.

Could you test with a newer Android version to confirm this is the problem?