No Messages or Triggers on Other Devices
  • All,

    I am able to send and receive on my own device, but when I test other devices, the messages and triggers don't appear. Here is what I am noticing

    On my device, I register successfully, then I create my default layer using a key, so I see the 409 status, Then I subscribe to the default layer. No problem
    On my other device, I do the exact same thing, but the layer ID comes back as a different ID. When I send the message, I see a response that only one device is in the area, and the message shows up on my phone, despite my other device sitting right next to me. I would think the message would go to both devices considering they are in the same area. 

    This is happening with all my testers with iOS 5.1.1 (same as mine) iOS 6, and iOS 6.0.1.

    Any suggestions?

    Thanks,
    Bruce
  • 3 Comments sorted by
  • I ran both devices side by side while running the debug screen. I saw the layer create using my key and layer subscribe from both devices, returning status 409 but with different layer IDs. I went to the console and ran layer subscription using each of the layer IDs and saw only one device subscribed. I expected to see two devices.

    Despite using the key when creating the layer and subscribing to it, I am getting the feeling there is an issue with my approach, and each user is being subscribed to a different layer which is why triggers and messages originating from one device are not getting through to another device. 

    function CreateAndSubscribeDefaultLayer(userName, password, self){
    var defaultLayerID = global.GlobalVariables.defaultLayerID;
    geoloqi.session.postRequest('layer/create', {
    "client_id" : "xxxyyyzzz",
    "client_secret" : "aaabbbccc",
    "name" : "BAIRFINDER-DEFAULT",
    "key" : "BAIRFINDER-DEFAULT",
    "public" : 1,
    }, {
    onSuccess : function(data) {
    defaultLayerID = data.response.layer_id; 
    Ti.API.info("Creation of default layer succeeded");

    geoloqi.session.postRequest("layer/subscribe/" + defaultLayerID, {
    //"user_id" : loggedInUser
    }, {
    onSuccess : function(data) {
    if (Ti.Platform.osname != 'android')
    {
    testflight.passCheckpoint("DefaultLayerSubscriptionSuccess");
    }
    Ti.API.info("Subscription to default layer succeeded");
    Ti.API.info(JSON.stringify(data));
    var MainView = require('ui/common/MainView');
    var mainView = new MainView(userName, password);
    self.add(mainView);
    },
    onFailure : function(data) {
    Ti.API.info("Subscription to default layer failed");
    Ti.API.info(JSON.stringify(data));
    var MainView = require('ui/common/MainView');
    var mainView = new MainView(userName, password);
    self.add(mainView);
    }
    }); 

    },
    onFailure : function(data) {
    Ti.API.info("Creation of default layer failed");
    }
    });
    }


  • I ran layer/info for each layer ID reported by layer/create with an identical key. 

    This is from my device

    {
    "layer_id": "3w6d",
    "user_id": "1y_E",
    "type": "normal",
    "name": "BAIRFINDER-DEFAULT",
    "description": "",
    "icon": "http://geoloqi.com/images/default_layer.png",
    "public": 1,
    "public_userlist": 0,
    "url": "https://a.geoloqi.com/layer/description/3w6d",
    "trigger_rate_limit": 30,
    "key": "BAIRFINDER-DEFAULT",
    "extra": {},
    "subscription": false,
    "settings": false,
    "bounds": {
    "sw": {
    "latitude": 40.335494995117,
    "longitude": -79.971977233887
    },
    "ne": {
    "latitude": 40.335494995117,
    "longitude": -79.971977233887
    },
    "center": {
    "latitude": 40.335494995117,
    "longitude": -79.971977233887
    },
    "radius": 0,
    "map": "http://map.geoloqi.com/40.335494995117,-79.971977233887"
    }
    }

    This is from my wife's device

    {
    "layer_id": "1KuX",
    "user_id": "fZo",
    "type": "normal",
    "name": "BAIRFINDER-DEFAULT",
    "description": "",
    "icon": "http://geoloqi.com/images/default_layer.png",
    "public": 1,
    "public_userlist": 0,
    "url": "https://a.geoloqi.com/layer/description/1KuX",
    "trigger_rate_limit": 30,
    "key": "BAIRFINDER-DEFAULT",
    "extra": {},
    "subscription": {
    "subscribed": 1,
    "date_subscribed": "2013-01-30 02:13:12",
    "trigger_rate_limit": null
    },
    "settings": [],
    "bounds": false
    }



  • Changed to a hard-coded layer ID and everything is fine. 

    Might want to check the docs regarding layer de-duping though. They lead users to believe that creating a layer with a key will return the original data including the layer ID if the layer with the key exists. That is clearly not accurate.

Howdy, Stranger!

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

In this Discussion