How can I construct an application by utilizing designated keys through the Phonegap Build API?

I'm currently utilizing the Phonegap Build API for my project.

For connecting to the Phonegap plugin, I am making use of a PHP library that is open source.

If you're interested, you can find it here: https://github.com/mradionov/phonegap-build-api

Everything is running smoothly and all tasks are being accomplished successfully, such as adding keys and uploading apps.

However, I have encountered an issue where I need to upload and build the app using a specific key for each platform.

In order to upload the app, I am following this method:

$res = $api->updateApplicationFromFile(3334534, 'path/to/myapp.zip', array(
  'title' => 'The APP title',
  // refer to the documentation for more options
));

This method works perfectly fine for uploading the app.

Now, when attempting to upload the app using the same method but with a specific key selected for building, like this:

 $res = $api->updateApplicationFromFile(3334534, 'path/to/myapp.zip',
  'title' => 'The APP title',
  'keys' => 1435671
  // refer to the documentation for more options
));

This process fails to execute anything, and there are no visible errors either!

According to the Phonegap API documentation, we should send the following to the API:

keys":{"ios":123,"android":567,"winphone":72}

The numbers mentioned represent the keys/certificates that have already been uploaded onto the Phonegap system.

If anyone has any advice on resolving this issue, please share your thoughts!

Thank you in advance.

Answer №1

Finally stumbled upon the solution.

Essentially, I realized that passing the values as an array was necessary, like this:

'keys' => array("ios" => XXXXXXX, "android" => XXXXXXXX),

So, my code now looks like this:

 $res = $api->updateApplicationFromFile(3334534, 'path/to/myapp.zip',
  'title' => 'The APP title',
  'keys' => array("ios" => XXXXXXX, "android" => XXXXXXXX),
  // see docs for all options
));

Fortunately, this approach is effective...

Hopefully, this explanation benefits others.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Steps to Safely Transmit the Password through Ajax() Function in jQuery

I have implemented a Password textbox that starts with an empty value. When the user clicks on it and enters a password, the password will be updated in the database upon leaving the textbox (onblur event). I have successfully achieved this using ajax(). H ...

Retrieve the GET parameters from a URL string

Is there a simple way to extract GET variables passed through a URL in PHP? The URL is not for the actual page itself. For example, if I have a string like: What is the most effective method to retrieve the values of those variables? ...

Dealing with the placement of strings within arrays in PHP can sometimes result in unexpected behavior,

I'm currently experiencing an issue with a function that is used to extract a string located between two other strings. function string_between($str, $starting_word, $ending_word) { $subtring_start = strpos($str, $starting_word); $subtring_start ...

Assessment and designation within the if condition

I am curious to know if this code will function properly with all major versions of PHP? if ($foo != $bar && '' != $str = some_function($some_variable)) echo $str; The some_function($some_variable) returns a string, which is assigne ...

Enhance your Woocommerce experience with real-time cart updates using AJAX

Is there a way to dynamically update the cart content using AJAX when the 'update cart' button is clicked? I've been struggling to get the $fragments function to work properly, as it always returns true. I've also attempted to use WooC ...

verifying the AJAX validation request URL

I am seeking a way to ensure that the valuable data generated by my ajax code on my webpage can only be accessed when the request originates from my site. This will prevent third parties from using the data without permission. I intend to implement this ...

Is it possible to modify the class attribute of an HTML element in PHP upon clicking an input?

In this assignment, I am restricted to using only PHP and cannot incorporate JavaScript. Currently, my code is set up to detect a post from an input type="submit" and then check for empty or filled text inputs. The code currently echoes text based on the c ...

What is the best way to iterate over an INSERT INTO query?

I'm facing an issue with executing the INSERT INTO MySQL statement multiple times within each loop of the while statement. Even though the loop seems to be working correctly based on the number of echoes, the INSERT INTO only works once. In simple t ...

PHP web application experiencing delays in response time following the execution of a PowerShell script

I'm currently developing a PHP web application on an IIS web server, and my goal is to create a read-only PowerShell live web console. Here's how the setup works: 1) On the main "console" page, there is a div element along with some buttons. I ...

How can you incorporate AJAX to add a paragraph element to your HTML document?

I have encountered an issue with two files in my project. The first file is an HTML document, while the second file is a PHP file called ajax_access_database.php. Originally, I intended for the PHP file to access a database, but complications arose, leadin ...

How can we make it possible for the app to be sent to the background using a button within the application?

Can the app be minimized to the background using a button within the application? Some applications achieve this by minimizing when the exit option is pressed, rather than closing completely... I am looking to implement this feature in my Ionic app or th ...

I am experiencing issues with my PHP quiz application; it is malfunctioning when I try

In my PHP MySQL quiz application, I have developed two sections: one for students and another for admins. In the admin area, there is an "addquestion" page where the code is as follows: <form class="form-horizontal " action="addquestion.php" method=" ...

Can you search for a specific word within a mediumblob file stored in the database?

Within my database, I have the following information: name mime size data Untitled.txt text/plain bigint(20) Mediumblob I need to search for a specific word within this file using a search command. ...

Flexigrid, link to fill the grid

Recently, I created an application that retrieves data from a MySQL database (datatype:json and url:post.php) to populate the grid successfully. However, I am now exploring different methods to retrieve the data rather than just using a PHP file. One idea ...

Having trouble returning a view from a subfolder in Laravel 4 Resource?

I've just started working with Laravel 4 and I have a controller named "OrderController" that contains the following code: public function index() { return View::make('order.index'); } In my views directory, there is a subfolder ca ...

Exploring the Pros and Cons of Incorporating ob_start() Function in PHP

Just recently, I encountered an issue with a PHP script that threw an error message: An alert popped up: Warning - Headers cannot be modified because they were already sent by (output started at C:\xampp\htdocs\jnexm\login.php:2) in ...

The JQUERY code for refreshing a div requires a timeout delay

I'm looking for a way to refresh a specific div on my website that's used for chat. Here's the code I currently have: var refreshId = setInterval(function() { $('#chat_grab').load('chat_grab.php?randval=' + Math.rand ...

It appears that the jQuery script is not loading properly

For my wordpress site, I have integrated jQuery using the wp_enqueue_script function along with the jQZoom script. In the header of my site, you can find the following lines in this order: <link rel='stylesheet' id='jQZoom_style-css&apo ...

Memory leakage during the traversal of an object network

Is object graph traversal in doctrine scalable? Take a look at this entity with a graph-like structure (which is guaranteed to be acyclic): /** * @ORM\Entity() */ class Node { //... /** * @ORM\ManyToOne(targetEntity="Node&q ...

Mpdf does not support inline CSS rendering

I recently implemented Mpdf into my Symfony project using Composer. The installation process involved running the following command: composer require mpdf/mpdf Next, I included the Mpdf.php file in autoload.php. Here is an example of how to use Mpdf in ...