【问题标题】:Worklight - Connect Trigger In Wifi Is Throwing An ErrorWorklight - Wifi 中的连接触发器引发错误
【发布时间】:2014-02-26 09:23:31
【问题描述】:

功能

loadWifiTracking() {

      var policy = {

            Wifi: {
                interval: 3000,
                signalStrengthThreshold: 15,
                accessPointFilters: [{SSID:"wifiName"}]
            }
      };

      var triggers = {

        Wifi: {

            DwellInSide: {
                type: "DwellInside",
                areaAccessPoints: [{SSID: 'wifiName'}],
                callback:function() {alert("Thank You For Being Here!");},
                dwellingTime: 5000
            },

            Connected: {
                type: 'Connect',
                connectedAccessPoint:[{SSID: 'wifiName'}],
                callback: function() {alert("Reached Here");}
            },

        }

      };


     WL.Device.startAcquisition(policy, triggers, acquisitionFailure);

         var acquisitionFailure = {

             Wifi : wifiFailure,

     };

     function wifiFailure(positionError) {

        alert("pe" + positionError);

     }

}

它抛出一个错误:

The WIFI Connect trigger with network specification: [{"SSID":"wifiName"}] will have no affect, since this network do not appear in WIFI acquisition policy.

知道具体的问题是什么吗?请帮忙。

【问题讨论】:

    标签: android triggers wifi ibm-mobilefirst android-geofence


    【解决方案1】:
    Connected: {
                    type: 'Connect',
                    connectedAccessPoint:[{SSID: 'wifiName'}],
                    callback: function() {alert("Reached Here");}
                },
    

    正如您在Connect 触发器中看到的那样,connectedAccessPoint 属性是单数的。因此,您不应传递 SSID 数组,而应传递单个 SSID。

    试试:

    Connected: {
                        type: 'Connect',
                        connectedAccessPoint:{SSID: 'wifiName'},
                        callback: function() {alert("Reached Here");}
                    },
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-04-26
      相关资源
      最近更新 更多