Log - mesosfer/Mesosfer-Cubeacon-iOS GitHub Wiki

Within Beacon modules, Mesosfer provide a specialized bucket Log that use for logging.

Objects and Types

Here is some predefined Log object :

  • beacon => NSString, define the beacon that detected.
  • event => NSString, define the event beacon that happen.
  • interval => NSNumber, define the interval between entering and exiting region of beacon.
  • module => NSString, define the module that used for logging. There are 4 modules :
    • MFBeaconModuleStoryline
    • MFBeaconModulePresence
    • MFBeaconModuleTagging
    • MFBeaconModuleMicrolocation

Sending Logs

Let’s say you want to send a MFLog to Mesosfer Cloud with sendAsyncWithBlock: method:

// create log object with beacon object, event and module
MFLog *log = [MFLog logWithBeacon:[MFBeacon beaconWithObjectId:@"beaconObjectId"]
                            event:MFBeaconEventFar
                           module:MFBeaconModuleStoryline];
[log sendAsyncWithBlock:^(BOOL succeeded, NSError * _Nullable error) {
    // check if there is an exception happen
    if (error) {
        NSLog(@"Error sending log, cause: %@", error);
        return;
    }
    
    NSLog(@"Log sent.");
}];