Search code examples
glympse

Glympse - How to create private groups in android?


I am checking glympse android sdk. I am not able to find programming guide for how to create private groups in android. There is reference of REST api for creating private groups using cards. But there is no step by step guide for it. Can anyone guide how to create private groups using android glympse sdk.


Solution

  • The private groups documentation is still under construction since it's a brand new feature. I'd be happy to get you started with some example code.

    To use private groups you'll be using the Cards feature of the SDK. To enable this feature, you have to make a small configuration change before starting the Glympse platform.

    GConfig config = glympse.getConfig();
    config.setCardsEnabled(true);
    ...
    glympse.start();
    

    After the platform is started, you'll be able to join/manage private groups using the CardsManager

    // Create a private group
    GCardManager cardManager = glympse.getCardManager();
    GCard card = GlympseFactory.createCard("559364b74d76b03a2f46096e", name);
    boolean result = cardManager.createCard(card);
    // Note: 559364b74d76b03a2f46096e is a constant that refers to a private group type card. 
    // Currently it is the only type of card available. A list of types returned from the server
    // can be obtained through cardManager.getCardTypes()
    
    
    // Invite someone to join a private group
    GInvite invite = GlympseFactory.createInvite(GC.INVITE_TYPE_SMS, "A friend", "555-555-1234");
    GCardInvite cardInvite = GlympseFactory.createCardInvite(invite);
    card.sendCardInvite(cardInvite);
    

    There is also reference documentation available

    https://developer.glympse.com/docs/core/client-sdk/reference/android/GCardManager https://developer.glympse.com/docs/core/client-sdk/reference/android/GCard

    etc. Everything GCard related is used for private groups.