sending REST API Parameters?
  • I have Logged in successfully through LQSession's RequestWithUsername method in sample iphone app you provided.But

    1)Which Rest API method I have to use in the application to get alert or message when i reach the region?

    2)How can i send parameters(layer_id,text etc) through runAPIRequest of LQSession?

    3)As I could not send parameters(layer_id,text etc), I send them through ASIFormDataRequest for geonote/create from sample application,
    it gives successful response,but i cant get message when i reach the region through the sample application? 

    4)is it possible to set alert message in geoloqi website (not through coding in client side) and get that alert in sample application you provided(client side)?



  • 3 Comments sorted by
  • Here are some answers to your questions:

    1) Use geonote/create or trigger/create to create the regions that will send alerts when you get there.

    2) You pass an NSURLRequest to the runAPIRequest method, so you can add parameters to the NSURLRequest object like you normally would. Alternatively, you can use the requestWithMethod:path:payload: method of LQSession to have it build the request for you automatically. The payload can be an NSDictionary of your key/value properties. This is the recommended solution.

    3) Try sending the request using the requestWithMethod:pay:payload: method described above. Also make sure you have enabled one of the tracking profiles in order to receive the notification. If you have set up a geonote or "message" type trigger, you won't get the notification unless you have also uploaded your push notification certificates. Otherwise you can use the "callback" type trigger to send the notification to an external URL.

    4) Yes this is possible. You can use the API console or write some server-side code to set up the notifications with our API. Please see the documentation for geonote/create or trigger/create for some examples.
  • Can you show me how to use something like this: 







     [[LQSession savedSession] requestWithMethod:@"GET" path:@"/location/last" payload:[NSDictionary dictionaryWithObjectsAndKeys:nil]];

    I'm trying to return the last long/lat but not sure how the payload parameter works.  I'm a bit new to iOS development.  Thanks

  • You can just set payload to nil for making GET requests.

    An example is in the demo app that comes with the SDK:

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion