我有这个:
public class ScheduledAgent : ScheduledTaskAgent
{
...
protected override void OnInvoke(ScheduledTask task)
{
var userSettings = Utils.LoadSettings();
try
{
var client = new CheckinServiceSoapClient();
var token = WsApiCaller.Token;
var point = ... // User Location;
if (point != null)
{
client.UserTrackAsync(token, userSettings.UserId,
point.Latitude, point.Longitude,
point.Position.Location.HorizontalAccuracy,
point.Position.Location.Altitude,
point.Position.Location.Speed,
point.Position.Location.VerticalAccuracy,
point.Position.Location.Course,
"BACKGROUND_AGENT");
}
}
catch
{
}
NotifyComplete();
}
}
OnInvoke 事件发生。但是没有执行 UserTrackAsync 的调用。