1

I have to implement live tracking using Glympse. In Glympse application you can share a link that link will show your current location. Now I have to get that link and send that link to server. I am searching for it but I am unable to get desired solution to get that link.

I have got examples form https://developer.glympse.com/docs/core/client-sdk/downloads link.

Madhu
  • 33
  • 6

1 Answers1

0

The GlympseCreateDemo shows the steps needed to get the link, but here are the key parts.

// Create the ticket for the given duration.
GTicket ticket = GlympseFactory.createTicket(duration, null, null);

// For the recipient list, we create a single "LINK" recipient. This
// means we want a recipient URL for the new Glympse without having
// the Glympse API actually send the invite out to anyone.
GInvite recipient = GlympseFactory.createInvite(GC.INVITE_TYPE_LINK, null, null);
ticket.addInvite(recipient);

// Call sendTicket to create the ticket and the recipient URL.
_glympse.sendTicket(ticket);

To listen for when the link is available

// The object you pass to this method must implement GEventListener
// In the demo this is done in GlympseCreateDemoActivity.java
ticket.addListener(this);

// Once the invite is ready you will get this event
@Override public void eventsOccurred(GGlympse glympse, int listener, int events, Object obj)
{
    if (GE.LISTENER_TICKET == listener)
    {
        if (0 != (events & GE.TICKET_INVITE_CREATED))
        {
            GTicket ticket = (GTicket) obj;
            // This string will contain the link that you can send to your server
            String theUrlLink = ticket.getInvites().at(0).getUrl();
        }
    }
}
  • After sharing a Glympse. we have an icon on status bar that is showing the status of shared Glympse. Can we remove it from status bar(from notification)? – Madhu Dec 15 '16 at 06:23
  • 1
    It is possible to prevent those notifications. GlympseService.enableGlympseNotifications(false); This must be called before calling start() on the Glympse platform – Nick Glickenhouse Dec 16 '16 at 19:05
  • In my application I have send the link to the server not to the friend. Is there any way to direct send glympse link using RestAPI (ie. post api)? Or who can be the recipient for Glympse Location link? can I share a link with server? – Madhu Dec 22 '16 at 06:47