• Categories
  • Recent
  • Tags
  • Popular
  • Solved
  • Unsolved
  • Users
Skins
  • Light
  • 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
About
Posts
12
Topics
0
Groups
0
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.


  • 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.


  • 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.


  • UpdateGroupEntityData doesn't update the "updatedAt" field.
  • JonathanJ Jonathan

    The fix will be going into the 4.2 patch on Tuesday. (Sept 17th) - now Wednesday Sept 18th.


  • UpdateGroupEntityData doesn't update the "updatedAt" field.
  • JonathanJ Jonathan

    Thanks for reporting the issue. A developer has been assigned the issue and is working on the fix. We will let you know when it's live 🙂


  • 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"
        }
      }
      ...
    

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

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


  • GetMyGroups doesn't return anything in requested
  • JonathanJ Jonathan

    Hey,

    The GetMyGroups will return the group requests and invites made to the current profile.

    As you noticed, to get the requests and invites made to a group (from other profiles), you need to use ReadGroup.

    This flow is working as intended. Groups and profiles are separate objects, and both can make invites and receive requests.

    So using GetMyGroups: here would be an example of a user that has made a group request, and has received a group invite.

    {  
       "data":{  
          "requested":[  
             {  
                "groupType":"DiscussionGroup",
                "groupId":"ad1ae126-d030-4d21-92c5-3e9d0b959647",
                "memberCount":1,
                "name":"Dark Roast",
                "invitedPendingMemberCount":0,
                "requestingPendingMemberCount":1,
                "ownerId":"f86a20d4-51a3-4594-a5b0-90111bf55e6d",
                "isOpenGroup":false
             }
          ],
          "invited":[  
             {  
                "groupType":"DiscussionGroup",
                "groupId":"b1d958e3-d196-45e2-9567-8efeb3296482",
                "memberCount":1,
                "name":"Local Coffee Shops",
                "invitedPendingMemberCount":1,
                "requestingPendingMemberCount":0,
                "ownerId":"f86a20d4-51a3-4594-a5b0-90111bf55e6d",
                "isOpenGroup":true
             }
          ],
          "groups":[  
    
          ]
       },
       "status":200
    }
    

    Hope that helps!


  • 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.


  • 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.


  • '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


  • '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

  • Login

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