Phonegap Build API - set build key issue

  • 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: prntscr.com/e0mbzi

    In my code after the authentication:

    pgBuild.auth({ username: phonegapBuildCredential.username, password: phonegapBuildCredential.password }, authenticationResponse);
    [/code:8beld4wn]
    
    [code:8beld4wn]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);
       }
      });
    
    }
    [/code:8beld4wn]
    and also 2 function to unlock/update the keys, here is one:
    [code:8beld4wn]function unlockiOSKeyMethod(api){
      var unlockiOSKeyForm = {
        form: {
          data: {
            password: 'passwd1234'
          }
        }
      };
      var iOSkeyID = (buildForProduction) ? '637072' : '638123';
    
      api.put('/keys/ios/' + iOSkeyID, unlockiOSKeyForm);
    }
    
    [/code:8beld4wn]
    
    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:8beld4wn]var options = {
           form: {
             data: {
               platforms: ['android', 'ios'],
               key: {
                 ios: keyid
               }
             },
           file: './www/ppmobilev3.zip'
          }
         };
    [/code:8beld4wn]
    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 <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile" /> Thanks
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • This is not a bug report for C2, please contact PhoneGap Build support if you need help with their service.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)