brainCloud supports a wide range of popular in-app purchases, including Google Play, Apple, Facebook, Amazon, and Steam, etc.. In most cases, the purchase process is initiated through the corresponding IAP plugin that you need to download into your Unity project. Then, verify the receipt received from the purchase outcome with brainCloud by calling VerifyPurchase API. It should be noted that the necessary configuration for the IAP store must be set up in the brainCloud portal for your app, including the products section and platforms section. Some store integration examples are available on our documentation website -- https://docs.braincloudservers.com/learn/portal-tutorials/store-integration-google/
Hope this helps!
JasonL
Posts
-
-
You could also consider using the brainCloud relay server's SendToAll() function in this situation.
-
Hi Kuabs, you can use brainCloud webhooks to achieve this feature, the steps are as follows.
- Create a cloud code script, in this example use the name "webhook_forgotPassword", and paste the following code into the script.
"use strict"; function main() { var response = {}; bridge.logDebugJson("Script inputs", data); var userEmail = data.parameters.email; response.stringResponse = "webhook is processing user email reseting..." + data.parameters.email; // validating the user email if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(userEmail)) { // checking if the email is existed in brainCloud users var context = { "pagination": { "rowsPerPage": 20, "pageNumber": 1 }, "searchCriteria": { "emailAddress": userEmail }, "sortCriteria": { "playerName": 1 } }; var userProxy = bridge.getUserServiceProxy(); var postResult = userProxy.sysGetPage(context); if (postResult.data.results.count > 0) { var userProfileID = postResult.data.results.items[0].profileId; // sending password reset email postResult = userProxy.sysSendPasswordResetEmail(userProfileID); if (postResult.status == 200) { response.stringResponse = "password reset email has been sent to user's email:" + userEmail; } else { response.stringResponse = "system error with sending email..."; } } else { response.stringResponse = "user doesn't exist with the email you provided"; } } else { response.stringResponse = "user's email is invalid."; } return response; } main();
-
Open Design | Cloud Code | WebHooks page, and create a WebHook link to the script you created from the previous step. Copy down the WebHook URL for the next step.
-
Now, you have completed the work from brainCloud. Next, open your client app editor (if you are using Unity), define the WebHook URL as a variable, and link it to your forgotEmail object (could be a link or button in your app) onClick event, making it trigger this URL when the user clicks with Application.OpenURL command. Grab user inputted email and append it as an email parameter to the URL as follows:
const string passwordResetWebhookUrl = "https://portal.braincloudservers.com/webhook/12832/forgotPassword/6dc675bb-f8b4-495f-ac5e-1f0658bfe09c"; Application.OpenURL(passwordResetWebhookUrl + "?email=" + userEmail);
-
Run your app to test, you should get a similar pop-up window as follows once a user clicks the forgotEmail object,
-
Check the reset email in your test email account...
-
Exactly, the error status code returned from the individual method can be incorporated into the script response.
-
Note that the response status code for running a script indicates whether the script has been executed successfully or not. To return the status of the internal methods that were executed, it is usually to include them in the customized response.
The best place to debug your cloud code script is the portal script editor, which can show the stack trace of your code, also the logs you added. -
I believe that you can integrate the brainCloud C++ library as a third-party library within Gamemaker. brainCloud C++ library can be found here -- https://github.com/getbraincloud/braincloud-cpp
-
Thank you for bringing this to our attention. We will proceed to include this API in the list.
-
Hi Kirlos, as you can see from the response's
message
field, there are two elements (id
andname
) underneath, you need to append.id
to specify the first search field forid
, so change the"message.from"
to"messsge.from.id"
should solve this problem. -
You can hook the script to brainCloud authentication API and check the
loginCount
from the response, the related doc can be found here. -
Call AttachUniversalIdentity() method from client lib, the
username
is uniqueness enforced. -
Hey, there must be some syntax error in your script, would you be able to provide your script code here?
-
Hi Dylan, actually, the argument purchaseData for StartPurchase() method takes the Steam Item ID (from Edit Price Entry pop-up) as the input field (not the Item ID from the product list)
-
Hi Kenneth, our current HTTP Client service doesn't support DELETE with query args yet, we probably add a new DELETE method that takes this parameter in our next release.
-
You may write a pre-hook cloud code script with your validating logic and integrate it with
[TurnShieldOn()](https://getbraincloud.com/apidocs/apiref/?cloudcode#capi-matchmaking-turnshieldon)
method. -
You can bypass the peer dependencies by adding
--legacy-peer-deps
flag to yournpm install
. After modifyingpackage.json
, then usenpm-install-peers
to install the rest of peer dependencies. -
Here is the thing, the input parameter
data
returned from our service proxy is a Java Map object, which does NOT support a number value as key when accessing value using object[key] syntax.A simple solution for this case is to convert the Java Map object to a real javascript JSON object like below:
data = JSON.parse(JSON.stringify(data));
-
(Post the answer from brainCloud chat channel)
Actually, there is a workaround that you can perform the tournament rewards adjustments,
- Turn off the auto claim
- Add a post-hook to Authenticate instead <- where auto-claim would normally run
- And in the post-hook look to see if they have tournament rewards, and if they do, claim them there - performing any award adjustments that need to be made.
-
(Note: this issue has been solved through our online chat support.)
-
Hi Reza, a simple workaround I would recommend is using our atomic methods, such as IncrementGlobalStats, to form the field values with the returned value of that method and some other characters you selected. (defined a global statistic ahead of time, call IncrementGlobalStats() get the returned current value of the global statistic, e.g.
123
, then combine with the name you selected to a unique name, such asname_123
)
[Unity] In App Purchases
Could RTT be used to broadcast player-authoritative movement periodically?
How to let a user request Email Password Reset when they aren't authenticated?
Is there a place I can see all possible error code that can come back from various APIs?
Is there a place I can see all possible error code that can come back from various APIs?
Can I use Braincloud with Gamemaker?
UserItems.AwardUserItem cannot be blocked for clients
getMessagesPage with $or field not working probably
Execute script when new user is registered
Convert Anonymous to username/password
bridge.include doesn't exists
Steam StartPurchase: No docs, no success
HTTP Client API - DELETE calls
Limiting number of async matches
NPM braincloud package install
Using numbers as JSON key.
Tournament Questions
Anyone available for Freelance?
Unique field for a Custom Entity