GlympseCreateDemo показывает шаги, необходимые для получения ссылки, но вот ключевые части.
// 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);
Для прослушивания, когда ссылка доступна
// 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();
}
}
}
После обмена Glympse. у нас есть значок в строке состояния, показывающий статус общего Glympse. Можем ли мы удалить его из строки состояния (из уведомления)? – Madhu
Можно предупредить эти уведомления. GlympseService.enableGlympseNotifications (ложный); Это нужно вызвать перед вызовом start() на платформе Glympse –
В моем приложении я отправил ссылку на сервер не другу. Есть ли способ напрямую отправить ссылку glympse с помощью RestAPI (т. Е. Post api)? Или кто может быть получателем ссылки Glympse Location? могу ли я поделиться ссылкой с сервером? – Madhu