示例#1
0
 static AwarenessFence CreateLocationFence()
 {
     return(AwarenessFence.Or(
                LocationFence.Entering(0, 0, 1000),
                LocationFence.Exiting(0, 0, 1000),
                LocationFence.In(0, 0, 1000, 100)
                ));
 }
 private async Task <Statuses> RegisterLocationFence() => await Awareness.FenceApi.UpdateFencesAsync(_googleApiClient, new FenceUpdateRequestBuilder()
                                                                                                     .AddFence(LocationFenceKey, LocationFence.Entering(Latitude, Longitude, Radius)
                                                                                                               , PendingIntent.GetBroadcast(this, 10001, new Intent(FenceReceiverAction), PendingIntentFlags.UpdateCurrent))
                                                                                                     .Build());