{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","results":{"codes":[]},"settings":"","params":[]},"next":{"description":"","pages":[]},"title":"React Native Functionality","type":"basic","slug":"react-native-functionality","excerpt":"An overview of available React Native functionality","body":"The Sailthru Mobile React Native library wraps the native SDKs and so the exposed methods follow the native methods quite closely. There are some differences however, particularly in how the responses should be handled, which is why we have created this guide as a reference for React Native development.\n\n### No Start Engine\nA major difference in the React Native SDK is that there is no `startEngine` method. The engine is started automatically within the React Native library when the modules are created.\n\n### Message Stream\nA guide to working with the message stream can be found [here](developing-a-custom-message-stream).\n\n### User Data\nA guide on how to handle collecting user data can be found [here](collecting-user-data).\n\n### Get Device ID\nReturns the Device ID for this device:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"SailthruMobile.getDeviceId().then(function(id) {\\n\\t// Handle Device ID\\n}, function(e){\\n\\t// Handle error\\n});\\n\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n### iOS Only methods\nThese methods only have an effect on the iOS platform. They can be safely called on both platforms but they will have no impact on Android:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"// Turns on or off iOS SDK crash handlers\\nSailthruMobile.setCrashHandlersEnabled(true);\\n\\n// Registers for push notifications\\nSailthruMobile.registerForPushNotifications();\\n\\n// Used to dismiss message detail presented in SailthruMobile.presentMessageDetail()\\nSailthruMobile.dismissMessageDetail()\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n### Track and Personalise methods\nA guide to implementing track and personalize can be found [here](using-spm-on-mobile).","updates":[],"order":20,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"5e6156bf5e4a51006dcd817b","project":"55e67aaa9cc7c62b00c4a1ea","version":{"version":"1.5","version_clean":"1.5.0","codename":"ST Rebrand","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["5e6156bf5e4a51006dcd8120","5e6156bf5e4a51006dcd8121","5e6156bf5e4a51006dcd8122","5e6156bf5e4a51006dcd8123","5e6156bf5e4a51006dcd8124","561c61b4ad272c0d00a892df","586c014c0abf1d0f000d04d4","58991d2ad207df0f0002186b","5e6156bf5e4a51006dcd8125","5e6156bf5e4a51006dcd8126","5af0fe494ca2730003cbc98a","5af0fe55ec80af0003804ca2","5e69868cbd5dcb006b35867b","5e6986ca2c6652006791b6e8"],"_id":"5e6156bf5e4a51006dcd818c","project":"55e67aaa9cc7c62b00c4a1ea","__v":2,"forked_from":"5b720760c44b7600034b7a08","createdAt":"2015-09-02T04:27:23.612Z","releaseDate":"2015-09-02T04:27:23.612Z"},"category":{"sync":{"isSync":false,"url":""},"pages":["5e6156bf5e4a51006dcd812a","5e6156bf5e4a51006dcd812c","5e6156bf5e4a51006dcd812d","5e6156bf5e4a51006dcd812e","55e682b7de6fef23009480dc","5e6156bf5e4a51006dcd812f","5e6156bf5e4a51006dcd8130","5e6156bf5e4a51006dcd8131","5e6156bf5e4a51006dcd8132","5e6156bf5e4a51006dcd8133","5e6156bf5e4a51006dcd8134","5b720760c44b7600034b79bc","5e6156bf5e4a51006dcd8135","5e6156bf5e4a51006dcd8148","5e6156bf5e4a51006dcd8149","5e6156bf5e4a51006dcd814a","5e6156bf5e4a51006dcd814b","5e6156bf5e4a51006dcd814c","5e6156bf5e4a51006dcd814f","5e6156bf5e4a51006dcd8150","5e6156bf5e4a51006dcd8152","561c6ca0be5fb20d00077754","5e6156bf5e4a51006dcd8157","5e6156bf5e4a51006dcd8158","5b720760c44b7600034b79e2","5e6156bf5e4a51006dcd8159","5e6156bf5e4a51006dcd815a","5e6156bf5e4a51006dcd815b","5e6156bf5e4a51006dcd815c","56cfa5386c5d7a13005eec0f","56e73d86555c030e00a52a73","56e7460c9000b120000ffe2e","56e8c19e99c6400e003820cf","56e8c53fc88bf80e00f8bed8","56f06ff4d386ce0e008e9b21"],"title":"Install in your app","slug":"install-in-your-app","order":1,"from_sync":false,"reference":false,"_id":"5e6156bf5e4a51006dcd8121","__v":35,"createdAt":"2015-09-02T04:30:13.305Z","project":"55e67aaa9cc7c62b00c4a1ea","version":"5e6156bf5e4a51006dcd818c"},"user":"5b0b7a46a26e6400036604fd","createdAt":"2018-10-01T03:13:09.407Z","__v":0,"parentDoc":null}

React Native Functionality

An overview of available React Native functionality

The Sailthru Mobile React Native library wraps the native SDKs and so the exposed methods follow the native methods quite closely. There are some differences however, particularly in how the responses should be handled, which is why we have created this guide as a reference for React Native development. ### No Start Engine A major difference in the React Native SDK is that there is no `startEngine` method. The engine is started automatically within the React Native library when the modules are created. ### Message Stream A guide to working with the message stream can be found [here](developing-a-custom-message-stream). ### User Data A guide on how to handle collecting user data can be found [here](collecting-user-data). ### Get Device ID Returns the Device ID for this device: [block:code] { "codes": [ { "code": "SailthruMobile.getDeviceId().then(function(id) {\n\t// Handle Device ID\n}, function(e){\n\t// Handle error\n});\n", "language": "javascript" } ] } [/block] ### iOS Only methods These methods only have an effect on the iOS platform. They can be safely called on both platforms but they will have no impact on Android: [block:code] { "codes": [ { "code": "// Turns on or off iOS SDK crash handlers\nSailthruMobile.setCrashHandlersEnabled(true);\n\n// Registers for push notifications\nSailthruMobile.registerForPushNotifications();\n\n// Used to dismiss message detail presented in SailthruMobile.presentMessageDetail()\nSailthruMobile.dismissMessageDetail()", "language": "javascript" } ] } [/block] ### Track and Personalise methods A guide to implementing track and personalize can be found [here](using-spm-on-mobile).