1
我必须使用Glympse实现实时跟踪。在Glympse应用程序中,您可以共享链接,该链接将显示您当前的位置。现在我必须获得该链接并将该链接发送到服务器。我正在寻找它,但我无法得到想要的解决方案来获得该链接。如何获得共享Glympse链接?
我已经有例子形式https://developer.glympse.com/docs/core/client-sdk/downloads链接。
我必须使用Glympse实现实时跟踪。在Glympse应用程序中,您可以共享链接,该链接将显示您当前的位置。现在我必须获得该链接并将该链接发送到服务器。我正在寻找它,但我无法得到想要的解决方案来获得该链接。如何获得共享Glympse链接?
我已经有例子形式https://developer.glympse.com/docs/core/client-sdk/downloads链接。
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(假);在调用Glympse平台上的start()之前必须调用这个函数 –
在我的应用程序中,我已经将链接发送给服务器而不是朋友。有没有什么办法可以直接使用RestAPI发送glympse链接(即.api后)?或者谁可以成为Glympse Location链接的收件人?我可以与服务器共享一个链接吗? – Madhu