RocketChat / Rocket.Chat.Cordova

Rocket.Chat Cross-Platform Mobile Application via Cordova (DEPRECATED)
MIT License
104 stars 109 forks source link

Allow building for only one server #70

Open mrplow opened 8 years ago

mrplow commented 8 years ago

I think a cool feature when building your own apk would be to have a setting to make the app only connect to a specific server.

So for my own builds the apk would always connect to my own server and wouldn't prompt on first run which server to use.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

valessiobrito commented 8 years ago

+1 and with support a Self Signed Certificate SSL

pschonder commented 8 years ago

@mrplow, you could add something like this to your "www/branding/js/branding.js":

document.addEventListener("deviceready", onDeviceReady, false);

function onDeviceReady() {
    if(document.getElementsByClassName("server").length == 0) {
        document.getElementById('serverAddress').value="https://demo.rocket.chat";
        document.getElementById('serverAddressButton').click();
    }
}
pschonder commented 8 years ago

@valessiobrito, i think that's not possible because certificate validation is done by the underlying system (iOS/Android). I remember there is a debug switch in Cordova to disable Validation on Android but this is only for testing purposes.

valessiobrito commented 8 years ago

@pschonder It's possible using a cordova plugin. See: https://github.com/hypery2k/cordova-certificate-plugin

mrplow commented 8 years ago

@pschonder that worked great adding that code to branding.js