Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Solved
  • Unsolved
  • Users
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Darkly)
  • No Skin
Collapse
brainCloud Forums
JonathanJ

Jonathan

@Jonathan
Unfollow Follow
About
Posts
9
Topics
0
Shares
0
Groups
2
Followers
0
Following
0

Posts

Recent Best Controversial

  • Award Achievement Issue
    JonathanJ Jonathan

    Your code looks good, but awardAchievements takes an extra boolean parameter in cloud code, includeMetaData, which controls if the extra achievement metadata is returned in the json response.

    var includeMetaData = false;
    var achievementRes = gamificationService.awardAchievements(achievementIds, includeMetaData);
    

    The documentation will be updated to show the missing value.

    Thanks for reporting the issue.

    Cloud Code cloud code script gamification

  • Timeouts?
    JonathanJ Jonathan

    If the app makes a call to brainCloud that timeouts, it will generate a CLIENT_NETWORK_ERROR_TIMEOUT (90001) error in the failure callback.

    _bc.EntityService.GetEntitiesByType(entityType,
        (string response, object cbObject) =>
        {
          Debug.Log("SUCCESS");
        },
        (int statusCode, int reasonCode, string statusMessage, object cbObject) =>
        {
          switch (reasonCode)
          {
    
            case ReasonCodes.CLIENT_NETWORK_ERROR_TIMEOUT:
              {
                // Handle the timeout 
                break;
              }
          }
        });
    
    

    The brainCloud SDK will timeout after a set interval. Currently, in the 4.2 release, the default is 35 seconds, but this may be adjusted later.

    You can also call SetPacketTimeouts to set a custom amount for your timeout values. But the defaults are recommended.

    An example of handling a timeout error in Unity can be found in our AuthenticationErrorHandling example.

    APIs timeout unity

  • GetMyGroups never returns
    JonathanJ Jonathan

    This error has been since resolved.

    A help article has been made on the groupType page: http://help.getbraincloud.com/en/articles/3272656-design-groups-group-types

    If experience similar problems to this forum topic with our Unity library, ensure brainCloud has been added to a gameObject, and that gameObject is not disabled.

    APIs groups unity

  • Getting names for request and invites to a group
    JonathanJ Jonathan

    As an interim solution, you can add a cloud code script or a post-hook to retrieve the missing data, using the profileIds found in the request.

    https://getbraincloud.com/apidocs/apiref/#capi-friend-getsummarydataforprofileid

    
      ...
      "pendingMembers": {
        "382eb04f-f80c-4bfc-9a12-fca508cad476": { // <- These profile ids
          "role": "MEMBER",
          "attributes": {},
          "pendingReason": "ASKED_TO_JOIN"
        }
      }
      ...
    
    APIs group unity

  • Getting names for request and invites to a group
    JonathanJ Jonathan

    I am forwarding this to the devs to look into addressing.

    APIs group unity

  • Modules/Common code scripts?
    JonathanJ Jonathan

    You could also create a Global Property that houses your shared code.

    Properties can be set on the Design | Custom Config | Global Properties page.

    b9b4069f-603c-4d2b-aea5-ed58440ddc13-image.png

    function getFuzz() {
        return 'Fuzz';
    }
    
    function addTwoNums( a, b ) {
        return a + b;
    }
    

    And use the bridge to get the shared code via bridge.getGlobalProperty("sharedScripts").

    Example:

    var response = {};
    
    // First Load the shared scripts into a string object
    var sharedScripts = String(bridge.getGlobalProperty("sharedScripts"));
    
    // Output to the log - helps for debugging. Debug log is only written to when run from API explorer or CC editor
    bridge.logDebug("Loading shared code...", sharedScripts);
    
    // And now evaluate the functions so that they become part of the script.
    // Any errors in the code being evaluated will be reported as errors as if they
    // occurred in the script itself. This affects the line numbers the error is reported upon.
    eval(sharedScripts);
    
    // Now you can use any of the functions included...
    response.getFuzz = getFuzz();
    response.sum = addTwoNums( 5, 10 );
    
    response;
    

    This has been tested with up to 30k bytes of code.
    That said, isn't an officially sanctioned approach. We don't recommend putting more than 20-25kb in the shared code string.

    Cloud Code script

  • Modules/Common code scripts?
    JonathanJ Jonathan

    Unfortunately not really.

    You can call cloud code scripts from cloud code scripts (via the bridge.callScript() method).

    Otherwise, people have also just copied and pasted shared code at the top of their scripts.

    Cloud Code script

  • 'INVALID_TOKEN' When Sending Push Notifications
    JonathanJ Jonathan

    If it is a cert issue. These steps may help: https://www.mobiloud.com/help/knowledge-base/how-to-export-push-notification-certificate-p12/

    edit: this link seems to confirm the cert theory. Based on the error message: https://stackoverflow.com/questions/22568648/ios-production-push-notifications-invalid-token-from-apns-server

    APIs push notifications ios

  • 'INVALID_TOKEN' When Sending Push Notifications
    JonathanJ Jonathan

    Adding in, when we get an error using the device token, we remove it from memory on the brainCloud portal, to prevent spamming the system with bad tokens. So if you look under user Monitoring | User Monitoring | User Summary you won't see the deviceTokens on that profile (due to the error your reporting.)

    That said, your registration implementation and device token look fine. I don't think it's an issue with the token.

    So perhaps it's an issue with the cert?

    On the iCloud dashboard, I would check to ensure the cert used and uploaded with brainCloud had push notifications enabled.

    373168e8-de27-46b5-bb9e-eb0a659a3e77-image.png

    APIs push notifications ios
  • Login

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Solved
  • Unsolved
  • Users