1

I just used the tool in marketing cloud to send a push message that a programmer wrote for us. At first, I successfully sent outbound messages to both iOS and Android. Then we asked him to implement one more thing which is Geofencing. Just some phones received messages from pushing by using geofencing. He said he added the code like instructed in Github. Is there anything else beside what the instructions said? There are less than 10 lines of code in the instructions. If you could point out where he should check in the code in general, that would help us a ton.

successful = [[ETPush pushManager] configureSDKWithAppID:kETAppID_Debug             // Configure the SDK with the Debug App ID
                                          andAccessToken:kETAccessToken_Debug       // Configure the SDK with the Debug Access Token
                                           withAnalytics:YES                        // Enable Analytics
                                     andLocationServices:YES                        // Enable Location Services (Geofence Messaging)
                                    andProximityServices:YES                        // Enable Proximity services (Beacon Messaging)
                                           andCloudPages:YES                        // Enable Cloud Pages
                                         withPIAnalytics:YES                        // Enable WAMA / PI Analytics
                                                   error:&error];

[[ETLocationManager sharedInstance] startWatchingLocation];
[ETRegion retrieveGeofencesFromET];
[ETRegion retrieveProximityFromET];

- (void)applicationDidEnterBackground:(UIApplication *)application {
[[ETLocationManager sharedInstance]startWatchingLocation];
}

- (void)applicationDidBecomeActive:(UIApplication *)application {
[[ETLocationManager sharedInstance]stopWatchingLocation];
}
  • One thing of note; do not set Proximity to "YES" if you are not using beacons. "YES" should be reserved for features you are or will be using. CloudPages stands out as another uncommon feature, but it's burden on your application would be negligible. I will ping the iOS team regarding your question above. – Bill Mote May 2 '17 at 12:01
  • Thank for your help Bill. Great advice. I will inform the developer right away. – Ponpirat May 3 '17 at 2:18
3

You should remove the following lines of code. The SDK will handle retrieving the messages when it is appropriate and you do not have to initiate this.

[ETRegion retrieveGeofencesFromET];
[ETRegion retrieveProximityFromET];

- (void)applicationDidEnterBackground:(UIApplication *)application {
[[ETLocationManager sharedInstance]startWatchingLocation];
}

- (void)applicationDidBecomeActive:(UIApplication *)application {
[[ETLocationManager sharedInstance]stopWatchingLocation];
}

Geo-fence messages are not pushed to the device but rather downloaded and are available to display when the geo-fence is entered or exited.

As such, the geo-fence messages will get downloaded when your application comes to the foreground or a when a perimeter fence used internally is crossed. There is also a daily maintenance download which will contain any updated geo-fence messaging to ensure your application always has the latest data even if it is not being used or the device has not moved.

  • Can you explain further about the last paragraph. I am still confused. Q1. When you say "The geo-fence messages will get downloaded when your application comes to the foreground or a when a perimeter fence used internally is crossed.", do you mean the messages are only downloaded, not displayed? Q2. If my device does not cross the geo-fence, does it still receive geo-fence messages from daily maintenance? Thank you. – Ponpirat May 3 '17 at 10:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.