electron + simplewebrtc workable? - javascript

Does anyone use electron + simplewebrtc successfully?
I used simplewebrtc to build a web app. It works fine in browsers.
When I migrated it into electron, something weird happened.
At first I used two copies of my electron app to make them connect each other, but failed.
Then, I made a web browser version and a electron version connect each other.
First, only when the electron version joined the room first, and then made the web version join the room, they can connect each other. otherwise, if the order changes, they cannot get the event peer.pc.iceConnectionState to "connected".
Second, even if them are connected, data channel only works on one way. Only web version can send message to electron version. If I try to let electron version send a message to web version, nothing happened.
During the whole time, no any error was thrown.
Thank you in advance.
simplewebrtc 2.2.3 - 3.0.1
Electron: 1.7.6
Web browsers: Chrome 62, Opera 49, Chromium 58

Related

Launching on android WEBAPP with ADB

Is there a method to launch a web app using adb?
The web app is created using manifest.json and save on android using chrome browser.
I've tried to get the package name of the web application using adb shell pm list packages but nothing seems to match.
I want to launch my web app this way adb shell am start -n com.package.name/com.package.name.ActivityName
I've also tried this way adb shell am start -a android.intent.action.VIEW -d "url". This works but it is not what I am looking for.
Assuming you are coming from Javascript world (as you could have done this by looking at adb logs), this should be what you are looking for
adb shell am start -a com.google.android.apps.chrome.webapps.WebappManager.ACTION_START_WEBAPP -n com.android.chrome/org.chromium.chrome.browser.webapps.WebappLauncherActivity --es "org.chromium.chrome.browser.webapp_url" "{your_url}" --es "org.chromium.chrome.browser.webapp_mac" "{webapp_mac}"
Note that this url has to match the url/url-ending you have mentioned in the start_url that you have mentioned in the manifest.json of yours, else it will just open it as another chrome tab.
Another caveat here is you have to pass web app mac validation check, which is done by the core android class mentioned here - WebappAuthenticator
Chrome does not keep a store of valid URLs for installed web apps
(because it cannot know when any have been uninstalled). Therefore,
upon installation, it tells the Launcher a message authentication code
(MAC) along with the URL for the web app, and then Chrome can verify
the MAC when starting e.g. {#link #FullScreenActivity}. Chrome can
thus distinguish between legitimate, installed web apps and arbitrary
other URLs.
I gave it a shot to open one of the webapps I own. I gave up after a bit, getting lost in the cryptic algos. Maybe you will have some luck with it. All the best!!!

Universal Windows - Cannot Debug new JS Project - wwahost.exe unable to find target registration

I am using Visual Studio 2017. I am running VS as an administrator, though this is not the same account logged into my machine (if that matters).
I opened a brand new project -- Javascript-language Universal Windows blank app. I can confirm I am targeting the same version of Windows that I have on my local machine (build 15063). When I try to debug the project with Local Machine, I get the following error:
Unable to debug Windows Store app 'wwahost.exe'.
The debugger was unable to find the registration for the target
application. If the problem persists, try uninstalling and then
reinstalling the application.
I've tried repair-installing VS, reinstalling VS, installing the Remote Tools for VS 2017, creating an app package, and nothing. This is a brand new project. The process wwahost.exe is not running on my machine; when I try to run it out of my Win\Sys32 folder, I get the following error:
C:\Windows\System32\WWAHost.exe
This application can only run in the context of an app container.
Not sure what to do next. Please help.
Edit: So I'm running VS using an admin account, but it's not the same account with which I'm logged into my local machine. If I log in as the admin account I'm using for VS, it works OK. I want to be able to develop as a different user though.

Meteor: Can’t get updates to Android Emulator (Hot Code Push)

I'm doing mobile development on an Android Emulator with Genymotion. I can't get any code changes to show up on the emulator. I always get this error, even on Startup:
Skipping downloading new version because the Cordova platform version or plugin versions have changed and are potentially incompatible
I know this a protection mechanism from bad updates, but It happens all the time. I can't even make a small CSS or JS change. They all get blocked. I tried it on Android 4.4.4, 5.0 and 6.0.
I'm using Meteor 1.4.1.2 and I simply run meteor run android-device and it pops up on the Genymotion device.
Anyone know what's causing this?

Can't connect to local Node App

I just started with a little bit MEAN-Magic by following along this tutorial. It was working pretty good (installation and so on). Now I'm stuck at:
STEP 4: Creating an ExpressJS application
I executed express mytestapp, cd mytestapp, npm installand node app.jsand am able to see the folder structure in the Terminal, but if I open Safari with "http://localhost:3000" I get the message
Safari can't Connect To Server... Safari can't open the page "localhost:3000" because Safari can't connect to the server "localhost"
How can I troubleshoot this? I'm totally new to this. (Not sure if this matters, but I'm working from a mac at the moment).

Meteor app suddenly no longer runs on iOS

My Meteor-based app no longer works as designed on iOS, without me having changed anything relevant. The app still works when run from a local server (http://localhost:3000) as well as when hosted at meteor.com. But, in an iOS simulator and when deployed to an iOS device through xCode, the app fails to run properly.
The app opens with a form that needs to be filled in by the user. When submitting the form, on iOS, the entered values briefly are stored in session variables, but almost immediately the session variables are emptied and the form is displayed again. (What should happen is for an external JSON file to be loaded, based on the form values, after which the contents of that JSON file is manipulated and displayed.)
I just now upgraded to the latest version of Meteor, and xCode did an upgrade itself in the background.
The app is supposed to load a Google font file (from fonts.googleapis.com), but though this works fine when the app is served from either the localhost or meteor, the font does not appear to be loaded when the app runs on iOS.
I'm sorry I don't have actual example code (the whole app?) or a running version of the app that I can show you. As the app is not yet publicly available, I'm a bit reluctant to publish it here. :(
Is there a way to meaningfully debug a Meteor app running on iOS? Is there something obvious I'm missing in the deployment?
Turns out there's an issue with meteor 1.0.4 and building a project using Cordova (https://github.com/meteor/meteor/issues/3814).
I downgraded to meteor 1.0.3 through:
meteor update --release 1.0.3
Then, I deleted the Cordova folder in .meteor/local/ with
rm -R cordova-build
Then, I patched 1.0.3 to 1.0.3.2 with
meteor update --patch
This solved the problem.

Categories