angularjs - Android apps stopped working with newest versions of PhoneGap Build -
i use phonegap convert angularjs app android , ios. need upgrade latest version of phonegap ios 9, breaks android app.
specifically, stops ngresource working, can't authentication token server.
android works fine config.xml preference set
<preference name="phonegap-version" value="3.7.0" />
android fails send request server either of these
<preference name="phonegap-version" value="cli-5.1.1" /> <preference name="phonegap-version" value="cli-5.2.0" />
here angularjs login function , ngresource factory.
$scope.login = function () { authenticationservice.get({ 'clientid':$rootscope.clientid, 'clientsecret':$rootscope.clientsecret, 'username':$scope.logindata.username, 'password':$scope.logindata.password }, function(data){}, function(error){ toastr.error('authentication failed, please try again.'); } ) .$promise.then(function(response){ ... }); }; .factory( 'authenticationservice', function($resource, $rootscope) { return $resource( $rootscope.url+'/oauth/v2/token?client_id=:clientid&client_secret=:clientsecret&grant_type=password&username=:username&password=:password', { clientid:'@clientid', clientsecret:'@clientsecret', username:'@username', password:'@password' }, { get: { method: 'jsonp', params: { callback: 'json_callback' }, isarray: false } } ); })
does know has changed in newer versions of phonegap android cause this?
please add whitelist
plugin reference inside config.xml
<gap:plugin name="cordova-plugin-whitelist" source="npm" />
Comments
Post a Comment