Another plea for assistance - No triggers, no broadcast
  • Dear support folks, 

    If you could please spare a few minutes to assist me on this, I would be grateful, as would my wife, the (not so) merry (software) widow. 

    Problems:
    1) Triggers are created but never fire
    2) Broadcast messages fail with access denied on a layer I created.

    Here is my platform:
    Application type: mobile 
    Appcelerator Titanium SDK: 2.1.2 GA 
    Platform & version: iOS 5.0 
    Device: iOS simulator, iPhone 4s 
    Host Operating System: OSX 10.6.8 
    Titanium Studio: 2.1.2.201208301612 
    Titanium Geoloqi Module: 1.1

    Here is what I want to do:
    1) Have any user of my app issue an alert. An alert consists of an Appcelerator Event and a corresponding trigger with a radius of 500m
    2) I want the app to send a message to any user already in the trigger layer.

    Here is what I am doing:
    1) Creating a layer using current coordinates and a 500m radius
    2) Creating a place using current coordinates (probably unnecessary)
    3) Creating an entrance message trigger using the current coordinates
    4) Subscribing the current application user (from init, not using create_anon) to the new layer
    5) Sending a broadcast message to all users in the default layer using the geographic parameters of the new layer. 

    Debug Information:
    5) Broadcast Message Send - http://www.screencast.com/t/iwtCvFDaiWCN

    Any and all help is greatly appreciated.
    Bruce
  • 7 Comments sorted by
  • Hi Bruce, a couple things that will help:

    If you're using the layer/place/trigger methods, you can simplify the setup of those as follows:
    • Create a layer with just the name (lat,lng,radius is not needed for the layer for this)
    • Create the place with lat,lng,radius just like you have
    • Create the trigger by passing text, trigger_on, type, key, and place_id. You don't need to send the lat,lng for this if you're attaching it to a place. You also don't need to send layer_id as that will create a "global" trigger on all places on the layer, not what you are looking for.
    I will attempt to document this better on the website today.

    It looks like your attempt to broadcast a message failed because the layer ID sent to the broadcast method was different from the layer in the other screenshots.



  • Hi Aaron,

    I can't thank you enough for this help. This is exactly what was needed. I followed your flow to the letter, test ran the trigger through the API Console, and lo and behold, I have an alert. 

    Now the only odd thing is that when I click launch, the alert opens the Geoloqi app, not my app. Is this because my login in my app is also associated with my login in Geoloqi, or am I missing something else in code? Something in the callback perhaps?

    As for the flow, I think I got confused because the layer, place, and trigger all have lat, lon, and radius available and because all of the pieces of the flow I needed are in different places. I love the product. Any documentation changes are going to make it that much better.

    Thanks again,
    Bruce
  • Hi Aaron,

    Looks like I am in the home stretch. From what I can see everything in the log looks to be correct. Layers, places, triggers, and messages all have the proper ids etc. The only problem remaining is the messages don't get to my iPhone.

    If I send a message from Appcelerator APS console, the message arrives in under a minute. If I send a broadcast message using my app, I see a 200 status code, proper lat, long, and radius, and no message on my phone. 

    What is interesting is that I was getting the messages when I had the Geoloqi app on my iPhone, but the View button would launch Geoloqi, not my app. Now that I have deleted Geoloqi, I get nothing despite the 200 status code.

    Any and all help is appreciated,

    Thanks
    Bruce
  • OK, for fun I made a screencast of the debugger screen so you can see what is being sent from my app.

    Per your instructions, 
    • Create a layer with just the name (lat,lng,radius is not needed for the layer for this)
    • Create the place with lat,lng,radius just like you have
    • Create the trigger by passing text, trigger_on, type, key, and place_id.

    You can see in the video, 
    • Layer 1JS_ created with status 409. This indicates I have created the same layer before using "BAIRFINDER-DEFAULT" as the key before
    • Layer 1JS_ subscribed with status 200
    • Place 2Pkc created with status 200
    • Trigger 2kHp create on placeID 2Pkc with status 200
    • Broadcast message on layer 1JS_ sent to lat, lon, radius of placeID 2Pkc

    Still no broadcasts and no triggers. 

    Thanks,
    Bruce
  • Update

    I saw the trigger come through once even though it was set to be hit multiple times, and no broadcast message. Do broadcast messages get sent to the sender? Wondering if this might be the issue.

    Thanks,
    Bruce
  • Hi Bruce,

    It sounds like you're receiving the push notification through the Geoloqi application. This is probably because you logged in with the same Geoloqi account from our app. 

    The real problem is that this means something about the push certificates in your app is not configured properly. In this situation, you should actually receive two notifications, one from the Geoloqi app and one from yours if you've signed in with the same account in both apps. 

    My suggestion is to go through the push notification setup process again with getting the new certificates from apple. Full instructions are here: http://developers.geoloqi.com/ios/push-notifications
  • Hi Aaron,

    I made major progress, but still have some remaining issues.
    1) In DEV mode, the trigger gets hit exactly as I want. This is awesome. 
    2) In DEV mode, the broadcast message indicates 200 and shows sent to one push device. I never get the message. The only thing I can think of is that the broadcast message goes out immediately after the trigger, so it doesn't get sent to my device. I have yet to test this theory with multiple devices because of the next issue.
    3) After I set up for ad hoc distribution, I run the app and see the broadcast message with 200 status. This time however I see no push and one SMS sent using the identical code. 

    I have checked all my certs again and made sure they are uploaded.

    Your thoughts would be 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