Enabling About Page and Send Logs Features
The following plug-ins are used by Canvas Technology to implement the About Page and Send Logs features for mobile apps. These plug-ins come installed in the Canvas Technology framework package.
Plug-in | Description |
---|---|
cordova-plugin-app-preferences | This is a plug-in created by Canvas Technology and is used to store, retrieve, remove and display the app preference (About Page). |
cordova-plugin-device | This plug-in is used to get the device's hardware and software details. |
cordova-plugin-app-version | This plug-in is used to get the app details. |
cordova-plugin-canvas | This is a plug-in created by Canvas Technology to check if the device running the app is rooted or jail broken. |
cordova-plugin-uniquedeviceid | This plug-in is used to provide a unique ID to the device. |
cordova-plugin-file | This plug-in is used to read or write from the log file. |
cordova-plugin-email | This plug-in is used for emailing the log file to the app's support team. |
Perform the following steps to enable About Page and Send Logs feature on your mobile apps:
- Call the following APIs in the listener file containing the events to display the About Page and to send logs. Sample codes are as follows:
- showAboutPage
canvasHybridUtil.showAboutPage(function () { console.log("About Page Triggered!"); }, function (errormsg) { alert(errormsg); });
sendLogs
canvasHybridUtil.sendLogs(successCallback);
- showAboutPage
- Ensure that you replace your app's support team's mail ID in the Hybrid.xml file available in your app bundle.
In Android devices, the sendLogs API enables the end users to select the mail apps. After a mail app is selected, it will attach the app's log details and the app support team's mail ID automatically to the mail composer. The following screen shot shows how the sendLogs API functions in an Android device.
In iOS devices, the sendLogs API opens the default mail composer for the device with the attached log details and the mail ID as shown in the following screen shot.
If you want to add additional log messages to the mobile app log file, use the logToFile API. Sample code is as follows:
canvasHybridUtil.logToFile(logMsg);
Or
console.log("logMsg");
The canvasHybridUtil is the object of the class CanvasHybridUtil, that is present in the canvas.hybrid.util.js file.