Upload
others
View
3
Download
0
Embed Size (px)
Citation preview
Geotrigger Service: Overview, Location
Services, and Use CasesKen Leung
Sam Wong
Geotrigger Service
• Cloud-based
• Consumer-grade GPS
• Perfect for iOS and Android apps
Geotrigger Service: Overview, Location Services, and Use Cases
GeoEvent Processor
• On premise server appliance
• Can be installed behind firewalls
• Dedicated industrial-strength GPS
• Life or death? Choose GeoEvent Processor
• Tomorrow: 4:00PM Location: S227
Geotrigger Service: Overview, Location Services, and Use Cases
What could your app do
if it knew where it was?
Geotrigger Service: Overview, Location Services, and Use Cases
Geotrigger Service: Overview, Location Services, and Use Cases
What about
Battery
Drain?
Geotrigger Service: Overview, Location Services, and Use Cases
Increases power
near content
Decreases
power use
away from
content
Geotrigger Service: Overview, Location Services, and Use Cases
Text
Label
Rough
Mode
Least Battery
Drain
Delayed
Messaging
Geotrigger Service: Overview, Location Services, and Use Cases
Text
Label
Fine
Mode
Most Battery
Drain
Fastest
Messaging
Geotrigger Service: Overview, Location Services, and Use Cases
Text
Label
Adaptive
Mode
Less
Drain
Fast
Messaging
Geotrigger Service: Overview, Location Services, and Use Cases
Geotrigger Service: Overview, Location Services, and Use Cases
Use Cases
This bridge will be closed on Saturday for maintenance!
Geotrigger Service: Overview, Location Services, and Use Cases
traffic ahead!
Geotrigger Service: Overview, Location Services, and Use Cases
New house
for sale!
Geotrigger Service: Overview, Location Services, and Use Cases
Historic town hall, founded in 1897 on Capitol St.
Geotrigger Service: Overview, Location Services, and Use Cases
Geotrigger Service: Overview, Location Services, and Use Cases
Getting Started
Create an account at developers.arcgis.com/en/sign-up/
or log in if you already have an account
Geotrigger Service: Overview, Location Services, and Use Cases
Create an application developers.arcgis.com/en/applications/
Geotrigger Service: Overview, Location Services, and Use Cases
Register for Push Notifications
Apple
• Go to your Apple Developer account to get a Push Certificate (iOS)
• Make sure the push cert has been set on your app and that your app is registered to
handle push notifications
• https://developer.apple.com/notifications/
Geotrigger Service: Overview, Location Services, and Use Cases
Register for Push Notifications
Android
• Get a GCM key (Google)
• Make sure the GCM key is in the push notification settings for your app and that you
have set your GCM sender ID when you initialize the Geotrigger Service.
• developer.android.com/google/gcm/
Geotrigger Service: Overview, Location Services, and Use Cases
SDKs for iOS and Android
- Wraps native location services on each
platform
- Provides a set of tracking profiles for low,
medium, and high power consumption
- Push Notification Handling
Geotrigger Service: Overview, Location Services, and Use Cases
SDKApp Project
Geotrigger Service: Overview, Location Services, and Use Cases
Geotrigger SDK for iOS
• Get the SDK from Github or CocoaPods• pod ‘GeotriggerSDK’
• Ensure your app has ‘Location Updates’ and
‘Background Fetch’ background modes enabled
• Call one of the setupWithClientId: methods
Geotrigger Service: Overview, Location Services, and Use Cases
Geotrigger SDK for Android
• Get the Sample App and SDK from GitHub:• github.com/esri/geotrigger-sdk-android
• Change the package name in the sample app or add the
required permissions to your existing AndroidManifest.xml
• Use the GeotriggerHelper to start the Geotrigger Service
Geotrigger Service: Overview, Location Services, and Use Cases
Test your triggers!
• Create test triggers
• Walk around outside to test push notifications
• 100m radius minimum
Geotrigger Service: Overview, Location Services, and Use Cases
Geotrigger API
• Manage devices, triggers, and
tags
• Access trigger history
• Build custom statistics
Geotrigger Service: Overview, Location Services, and Use Cases
Submitting Your App to iTunes
• Location should be used to enhance
• Explain why you are using location in app
description
• Be prepared for app rejection, so submit at
least 2-3 weeks before you plan to launch
Geotrigger Service: Overview, Location Services, and Use Cases
Geotrigger Service API
Authentication
• The Geotrigger API uses OAuth2
• Requests to the Geotrigger API require an access token
• To get an access token make a request with the client_id and client_secret to the
“oauth2/token” endpoint of ArcGIS Online
• Devices register with ArcGIS Online using only the client_id, and are given a refresh
token in addition to the access token.
Geotrigger Service: Overview, Location Services, and Use Cases
Triggers
• Define what happens when someone enters or leaves a place
• Triggers have a location that can be a circle or a polygon (EsriJSON or GeoJSON)
• Date and time ranges can restrict when triggers are active
• Triggers can have a limit to the number of times they can be fired
Geotrigger Service: Overview, Location Services, and Use Cases
Tags
• Used to associate triggers with devices
• Device must share a tag with a trigger to fire the trigger
• Example: Trigger labeled with ‘restaurant’ tag, user subscribes to ‘restaurant’
coupons.
Geotrigger Service: Overview, Location Services, and Use Cases
Geotrigger Editor
Editor Overview
• A visual interface for managing triggers
• List all triggers and filter by tag or trigger ID
• Create triggers by drawing trigger boundaries as circles and polygons
• Define and update trigger rules
Geotrigger Service: Overview, Location Services, and Use Cases
Geotrigger API Routes
• /trigger/list
• /trigger/create
• /trigger/update
• /trigger/delete
Geotrigger Service: Overview, Location Services, and Use Cases
Geotrigger Editor: List View
Geotrigger Service: Overview, Location Services, and Use Cases
/trigger/list
Geotrigger Service: Overview, Location Services, and Use Cases
{"triggerIds": [...],"tags": [...],"geo": {...},
}
• List all triggers associated with an application
• All parameters are optional, used for filtering results:
Geotrigger Editor: Create/Update View
• Geotrigger Service: Overview, Location Services, and Use Cases
Tags
• Geotrigger Service: Overview, Location Services, and Use Cases
Condition
• Geotrigger Service: Overview, Location Services, and Use Cases
Action
• Geotrigger Service: Overview, Location Services, and Use Cases
Advanced Properties
• Geotrigger Service: Overview, Location Services, and Use Cases
POST /trigger/create
{"condition": {"direction": "enter","geo": {
"latitude": 45.5165,"longitude": -122.6764,"distance": 240
}},"action": {"callbackUrl": "http://example.com/trigger",
},"setTags": ["office", "red", “blue”],
}
• Geotrigger Service: Overview, Location Services, and Use Cases
Advanced Trigger Properties
• Trigger ID
- Custom IDs can be specified on create, but cannot be updated.
• Rate Limit
- Number of seconds between executions, per device. Default 30. Set to 0 for no
minimum.
• Times
- Maximum number of executions, per device. Default 0 for no maximum.
• Properties
- Arbitrary properties saved with the trigger.
• Geotrigger Service: Overview, Location Services, and Use Cases
Demo
Geotrigger Editor
Geotrigger Faker
Faker Overview
• A web application for sending location updates and testing triggers
• Create a fake device or spoof an existing device
• Draw a point and radius to send location updates and fire triggers from the comfort
of your workspace
• Geotrigger Service: Overview, Location Services, and Use Cases
Geotrigger Faker: Sending Location Updates
• Geotrigger Service: Overview, Location Services, and Use Cases
POST /location/update
{"locations": [{
"latitude": 45.5194753769039,"longitude": -122.67609357921172,"accuracy": 55,"timestamp": "2014-03-11T17:07:24.727Z"
}],"previous": {"latitude": 45.51976103506265,"longitude": -122.67519235698273,"accuracy": 67,"timestamp": "2014-03-11T17:07:27.313Z"
}}
• Geotrigger Service: Overview, Location Services, and Use Cases
Callback Payload
• JSON data that is sent to a callback URL when a trigger is fired
• Enable the callbackURL parameter within the trigger action.
• Can be used to create a customized app experience
• Geotrigger Service: Overview, Location Services, and Use Cases
Custom Notifications
• API provides a way to send a notification to a device
• Can be used with callback payload to send customized push notifications
• Target devices by ID, geography or tag
• Geotrigger Service: Overview, Location Services, and Use Cases
POST /device/notify
// request{
"tags": ["red"], "text": “Welcome Red Team!", "data": {"foo": “bar"}
}
// response{"devices": [
{"3XgGh30aTlEKlK91": "queued"},{"8907123u9yasdjkn": “queued"}]
}
• Geotrigger Service: Overview, Location Services, and Use Cases
Demo
Geotrigger Faker
Use Case Demo
Demo
Global Triggers
Self-Guided Tour
Demo
Labeled Triggers
Personalized Offers
Demo
Labeled Devices
Workforce Management
Demo
Combination Use Cases
Geo Coupon
Open Source
• Geotrigger Editor & Geotrigger Faker are open source
- github.com/esri/geotrigger-editor
- github.com/esri/geotrigger-faker
• Client Libraries in various languages:
- github.com/esri/geotrigger-js
- github.com/esri/geotrigger-ruby
- github.com/esri/geotrigger-go
- github.com/esri/geotrigger-python
Share your moment #EsriAPUC