From 6419361e2f9132d38ca02bfbec6fa095fa2212e3 Mon Sep 17 00:00:00 2001 From: Ethan Neff Date: Thu, 2 Mar 2017 00:07:46 -0800 Subject: [PATCH] fix: prevent crash on list on spotlight on android --- www/branch.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/www/branch.js b/www/branch.js index 67f996cf..0b81519e 100644 --- a/www/branch.js +++ b/www/branch.js @@ -373,7 +373,13 @@ Branch.prototype.createBranchUniversalObject = function (options) { * List item on Spotlight (iOS Only). */ obj.listOnSpotlight = function () { - return execute('listOnSpotlight', [obj.instanceId]) + if (deviceVendor.indexOf('Apple') < 0) { + return execute('listOnSpotlight', [obj.instanceId]) + } else { + return new Promise(function (resolve, reject) { + reject('iOS Spotlight only') + }) + } } resolve(obj)