Phonegap Build API - set build key issue

Bugs will be moved here once resolved.

Post » Thu Jan 26, 2017 2:49 pm

Message: danielemorina can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Hi,
I would like to start saying 'I don't know much about phonegap'...Said that I am working on automate the build process for my App and I am using Phonegap Build API to do so.
I am using Gulp to manage the different tasks and the issue I am is that I AM NOT ABLE TO SET THE KEY FROM THE API BUT ONLY FOR THE WEBSITE!!
Those are my keys set on the Phonegap Build website: http://prntscr.com/e0mbzi
In my code after the authentication:
Code: Select all
pgBuild.auth({ username: phonegapBuildCredential.username, password: phonegapBuildCredential.password }, authenticationResponse);


Code: Select all
I have the following callback:
    function authenticationResponse(e, api){
     console.log('AUTHENTICATION SUCCESSFULLY');

     unlockAndroidKeyMethod(api);
     unlockiOSKeyMethod(api);


  api.post(phonegapEndpoint + '/build', options, function(ee, data) {
    if(data != null && !ee){
      var buildStatus = data.completed;
      if(buildStatus) {
        buildCompletedAndReadyToDownload(api);
        return;
      }
      waitingForPendingBuild(api);
   }
  });

}

and also 2 function to unlock/update the keys, here is one:
Code: Select all
function unlockiOSKeyMethod(api){
  var unlockiOSKeyForm = {
    form: {
      data: {
        password: 'passwd1234'
      }
    }
  };
  var iOSkeyID = (buildForProduction) ? '637072' : '638123';

  api.put('/keys/ios/' + iOSkeyID, unlockiOSKeyForm);
}



I have read somewhere that I should specify the wanted key before sending it to the build server, so I have tried to add property to the 'options' passed to the Build service but it didn't work.

For instance, something like this:
Code: Select all
var options = {
       form: {
         data: {
           platforms: ['android', 'ios'],
           key: {
             ios: keyid
           }
         },
       file: './www/ppmobilev3.zip'
      }
     };

Also IF I change the keys from the Phonegap Build website, as soon as I run my script it builds whatever is selected on the website.

enter image description here Please let me know if you need any further information to get me some help :) Thanks
B
2
Posts: 1
Reputation: 152

Post » Tue Apr 18, 2017 11:30 am

This is not a bug report for C2, please contact PhoneGap Build support if you need help with their service.
Scirra Founder
B
387
S
230
G
88
Posts: 24,251
Reputation: 192,464


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 2 guests