How to set MOCA SDK to download only when connected to Wi-Fi

How to set MOCA SDK to download only when connected to Wi-Fi

The MOCA SDK has the capability to download data only when the "Wi-Fi Only" data transmission is activated. In order to do so, here are the calls for both Android and iOS:

Android SDK MOCA API

Java
/**
* Returns true if the "Wifi Only" data transmission setting is activated */ static boolean isWifiOnlyEnabled() /** * If true, limits data transmission to Wifi only */ static void setWifiOnlyEnabled(boolean enabled)


iOS SDK MOCA API

Objective-C
/** * Get status of the WiFi only transfer constraint. * * @return YES if the SDK is allowed to transmit data only when Wifi is available. * NO otherwise. */ + (BOOL)wifiOnlyEnabled; /** * Enables/disables the "WiFi only" transfer constraint. * @param enabled - if YES the SDK is allowed to transmit data only when Wifi is available. * NO otherwise. */ + (void)setWifiOnlyEnabled:(BOOL)enabled;

 

Reference:

    • Related Articles

    • How do I receive MOCA SDK actions in my third party API?

      MOCA has a feature called Cloud-Hook. This feature enables the MOCA SDK embedded into the client mobile App to deliver location-triggered actions directly to the Third Party campaigns module and deliver segmented and personalized content to end ...
    • Do you have a Web SDK?

      Yes, MOCA has the JS SDK that enables web applications written in HTML5/CSS to track a variety of user signals, such as browser, operating system, events triggered by user navigation and much more. MOCA JavaScript SDK is designed with this in mind: ...
    • How the MOCA SDK geo-location tracking works?

      Here's a diagram that draws the moving parts that involve location, and where our SDK comes into play: We rely strongly on the mobile device OS in order to gather precise and actionable locations.
    • Proximity guidelines: Geofencing - How to maximize detections

      Geofences Smartphones use a combination of sensors to estimate current position, depending on its availability. Specifically: GPS Wi-Fi Cellular networks Bluetooth GPS MOCA SDK does not use GPS directly, as this is a high battery consuming resource ...
    • Strategies to improve battery usage of our SDKs

      At MOCA we have designed our SDKs to be very efficient and use the minimum necessary battery for Proximity Marketing use cases. We prefer low energy solutions that do not involve GPS and, for Android, offer ways to fine tune the sensitivity of the ...