Layer Create Response Question
  • Hi All

    In my app I am creating a default layer prior to creating my anon user. My goal is to subscribe all anon users to this layer so I can send users messages when a new layer is created.

    I can see everything happening in the geoloqi debugger as I expect, but no message is received on my phone. When I create my new layer, I am using those coordinates and radius as the basis for sending the message to my users in the default layer. I just expect to receive a message when I create the new layer and I don't.

    Create Layer A
    Create Anon User
    User Subscribe Layer A
    Create Layer B Lat Lon Rad
    Send Message to Layer A using boundary Layer B Lat Lon Rad

    What I did notice is a response property in the default layer create call "bounds":false. I assume this means I didn't pass lat/Lon parameters when I created the layer. I assumed, perhaps incorrectly, that a layer without a lat, Lon, and radius would be a global layer. I now assume it is just a pinpoint, or perhaps just an empty container.

    If I want to have a default layer, should I just create it with my coordinates and a radius of 5 million meters so I can get coverage by most of North America?

    Thanks
    Bruce
  • 2 Comments sorted by
  • It sounds like the problem is that there was never any location data collected for the users, so the system doesn't know where they are.

    Here is what you should do:
    • As your application account, create Layer A. You'll do this only one time. Make a note of the layer ID that is returned.
    • From your app, after your user is created, subscribe them to this layer. Also make sure you have requested push notification permission and configured the certificates appropriately.
    • In the app, make sure you activate the SDK by setting the profile to "rough". This will cause the SDK to start sending location data.
    • Now you can send a message to anybody subscribed to the layer by using the message/broadcast method, sending a latitude,longitude and radius boundary.
    The layer bounds are calculated based on any places that are on the layer. If you don't have any places, you'll see an empty bounds parameter. 
  • Hi Aaron,

    Thanks for your reply. I have done pretty much what you have laid out with no change in result. 
    Once the user is logged in,

    1) I create Layer A with a key of "BAIRFINDER-DEFAULT"
    2) I subscribe the user to the Layer A using the returned layerID
    3) I set the profile to REALTIME
    4) I create place A using the layer ID returned from my Layer A creation
    5) I send a message broadcast using the lat, lon, and radius of place A and the layerID of layer A

    I see everything go through in the debug screen. I have done simultaneous testing using two iPhones
    1) Creating Layer A with a key of BAIRFINDER-DEFAULT results in 409 Conflict, which I believe it should. The layerID returned is
    Phone1: 1PuM
    Phone2: 1KuX
    2) Subscriptions are successful
    3) Message Broadcast sent from phone A shows 200 but only indicates one push message despite two phones being logged 
    in with software open. 

    The net result is that no broadcast messages are received by either phone. Trigger messages are received only if I 
    hard-code the profile instead of allowing the profile to be selected in settings.

    I am wondering if there is something I am doing wrong when setting up the layer A. I followed the de-duping docs and used the key value 
    to ensure the layer exists. I can hard-code the layerID instead and see if that works, but I expected the layer ID to be returned with a 409 
    to be the existing ID.

    I am also wondering if there is something else at work with the broadcast messages. I would expect to receive my own message unless I 
    missed the fact that the sender is not a recipient. I don't think this is the case though because when I was testing with only one device I was 
    still seeing 200 with push:1

    I am using production certs and my ad-hoc profile. The triggers were working. The messages do not.

    Any and all help appreciated.

    Thanks,
    Bruce

Howdy, Stranger!

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

In this Discussion