AMAs Vote on TikTok


AMAs Vote on TikTok { resolve(res); }); setTimeout(() => { reject(new Error(‘close webview no callback’)); }, 3000); }); */ }; window.__MAGIC__.action[‘custom’] = window.__MAGIC__.action[‘custom’] || {}; window.__MAGIC__.action[‘custom’][‘openpopup’] = function (actionParams, node, extra, args) { var newSchema = extra.schemaRenderComponent.resetSchemaByNodeId(actionParams.componentId, function () { return { show: true }; }); return { schema: newSchema }; }; window.__MAGIC__.action[‘custom’] = window.__MAGIC__.action[‘custom’] || {}; window.__MAGIC__.action[‘custom’][‘playcurrentlottie’] = function (actionParams, node, extra, args) { node = extra.schemaRenderComponent.getNodeById(node.id) || {}; var props = node.props || {}; var newSchema = extra.schemaRenderComponent.resetSchemaByNodeId(node.id, function () { return { playing: true }; }); return { schema: newSchema }; }; window.__MAGIC__.action[‘custom’] = window.__MAGIC__.action[‘custom’] || {}; window.__MAGIC__.action[‘custom’][‘openMyProfile’] = function (actionParams, node, extra, args) { window.__MAGIC__.action.magicUnifyJsb.call(‘getUserInfo’).then(function (res) { if (!res.is_login) { window.__MAGIC__.action.magicUnifyJsb.call(‘openLogin’); } else { window.__MAGIC__.action.magicUnifyJsb.call(‘openUserProfile’, { user_id: res.user_id }); } }); }; window.__MAGIC__.action[‘custom’] = window.__MAGIC__.action[‘custom’] || {}; window.__MAGIC__.action[‘custom’][‘openlive’] = function anonymous(actionParams,node,extra,args ) { window.__MAGIC__.action.jsb.app.openSchema({ schema: ‘aweme://videoRecord/live’ }); }; window.__MAGIC__.action[‘magicUnifyJsb’] = window.__MAGIC__.action[‘magicUnifyJsb’] || {}; window.__MAGIC__.action[‘magicUnifyJsb’][‘openLogin’] = function anonymous(actionParams,node,extra,args ) { window.__MAGIC__.action.jsb.app.openLogin(); window.__MAGIC__.action.jsb.bridge.on(‘H5_nativeEvent’, function (res) { if (res && res.type === ‘userLogin’) { window.location.reload(); } }); }; window.__MAGIC__.action[‘magicUnifyJsb’] = window.__MAGIC__.action[‘magicUnifyJsb’] || {}; window.__MAGIC__.action[‘magicUnifyJsb’][‘openLiveBySchema’] = function (actionParams, node, extra, args) { var params = { room_id: actionParams.room_id, user_id: actionParams.user_id, sec_uid: actionParams.sec_uid, enter_from_merge: ‘magic_page’, enter_method: node ? node.id : ”, magic3_comptype: node ? node.type : ”, magic3_activityId: window.__MAGIC__ && window.__MAGIC__.canvas && window.__MAGIC__.canvas.activityId, magic3_source: location.href.split(/magic_source=([^&]+)/)[1] || ‘default’ }; function cleanObj(obj) { for (var key in obj) { if (!obj[key] && obj[key] !== 0) { delete obj[key]; } } } cleanObj(params); var paramsKeys = Object.keys(params); var urlSchema = ‘sslocal://webcast_room?’; for (var key in params) { urlSchema += key === paramsKeys[paramsKeys.length – 1] ? key + ‘=’ + params[key] : key + ‘=’ + params[key] + ‘&’; } console.log(‘openLiveBySchema urlScheman’, urlSchema); location.href = urlSchema; }; window.__MAGIC__.action[‘magicUnifyJsb’] = window.__MAGIC__.action[‘magicUnifyJsb’] || {}; window.__MAGIC__.action[‘magicUnifyJsb’][‘adapter’] = function(config) { var request = { url: config.fullUrl, params: config.params || {}, method: config.method }; if(config.method === ‘post’){ request.params = config.originData; } return window.__MAGIC__.action.jsb.app.fetch(request).then(function(res) { return { status: 200, config: config, request: request, data: res }; }); }; window.__MAGIC__.action[‘magicUnifyJsb’] = window.__MAGIC__.action[‘magicUnifyJsb’] || {}; window.__MAGIC__.action[‘magicUnifyJsb’][‘appSendLog’] = function(actionParams) { return window.__MAGIC__.action.jsb.app.sendLogV3(actionParams); }; window.__MAGIC__.action[‘magicUnifyJsb’] = window.__MAGIC__.action[‘magicUnifyJsb’] || {}; window.__MAGIC__.action[‘magicUnifyJsb’][‘close’] = function anonymous(actionParams,node,extra,args ) { window.__MAGIC__.action.jsb.app.close(); }; window.__MAGIC__.action[‘magicUnifyJsb’] = window.__MAGIC__.action[‘magicUnifyJsb’] || {}; window.__MAGIC__.action[‘magicUnifyJsb’][‘openChallenge’] = null; window.__MAGIC__.action[‘magicUnifyJsb’] = window.__MAGIC__.action[‘magicUnifyJsb’] || {}; window.__MAGIC__.action[‘magicUnifyJsb’][‘openLiveRoom’] = function (actionParams, node, extra, args) { try { extra.tool.sendLog(‘goApp’, { compid: node.id, comptype: node.type, inappEvent: ‘goLiveRoom’, user_id: actionParams.user_id, sec_uid: actionParams.sec_uid }); } catch (error) { console.log(error); } var user_id = actionParams.user_id; var sec_uid = actionParams.sec_uid; window.__MAGIC__.action.jsb.app.openLive({ user_id: user_id, sec_uid: sec_uid, from: ‘jsbridge’ }, function (ret) { if (ret.room_id == 0) { window.__MAGIC__.action.jsb.app.openUserProfile({ user_id: user_id, sec_uid: sec_uid }); } }); }; window.__MAGIC__.action[‘magicUnifyJsb’] = window.__MAGIC__.action[‘magicUnifyJsb’] || {}; window.__MAGIC__.action[‘magicUnifyJsb’][‘openRecordWithMv’] = function (actionParams, node, extra, args) { window.__MAGIC__.action.jsb.bridge.call(‘openRecord’, { type: ‘mv’, args: { mv_id: actionParams.mvId } }); }; window.__MAGIC__.action[‘magicUnifyJsb’] = window.__MAGIC__.action[‘magicUnifyJsb’] || {}; window.__MAGIC__.action[‘magicUnifyJsb’][‘openSchema’] = function (actionParams) { window.ToutiaoJSBridge.call(‘openSchema’, { schema: actionParams.schema }, function (res) { console.log(res); }); }; window.__MAGIC__.action[‘magicUnifyJsb’] = window.__MAGIC__.action[‘magicUnifyJsb’] || {}; window.__MAGIC__.action[‘magicUnifyJsb’][‘openUserProfile’] = null; window.__MAGIC__.action[‘magicUnifyJsb’] = window.__MAGIC__.action[‘magicUnifyJsb’] || {}; window.__MAGIC__.action[‘magicUnifyJsb’][‘openVideoItem’] = null; window.__MAGIC__.action[‘magicUnifyJsb’] = window.__MAGIC__.action[‘magicUnifyJsb’] || {}; window.__MAGIC__.action[‘magicUnifyJsb’][‘share’] = function () { var url = document.querySelector(‘meta[name=”aweme:url”]’).getAttribute(“content”) || ”, title = document.querySelector(‘meta[name=”aweme:title”]’).getAttribute(“content”) || ”, image = document.querySelector(‘meta[name=”aweme:image”]’).getAttribute(“content”) || ”, desc = document.querySelector(‘meta[name=”aweme:description”]’).getAttribute(“content”) || ”; var reg = new RegExp(‘^http(s{0,1})://’); if (image && !reg.test(image)) { image = ‘https:’ + image; } window.__MAGIC__.action.jsb.app.share({ platform: ‘share_native’, title: title, desc: desc, url: url, innerUrl: url, image: image }); }; window.__MAGIC__.action[‘urlScheme’] = window.__MAGIC__.action[‘urlScheme’] || {}; window.__MAGIC__.action[‘urlScheme’][‘video’] = function (actionParams, node, extra, args) { var item_id = actionParams.item_id; return ‘snssdk1233://aweme/detail/’ + item_id + ‘?refer=web’; }; window.__MAGIC__.action[‘urlScheme’] = window.__MAGIC__.action[‘urlScheme’] || {}; window.__MAGIC__.action[‘urlScheme’][‘webview’] = function (actionParams, node, extra, args) { var url = actionParams.url; return ‘snssdk1233://webview?url=’ + url; }; window.__MAGIC__.action.jsb = window[‘tiktok’]; window.__MAGIC__.action.magicUnifyJsb = window.__MAGIC__.action.magicUnifyJsb || {}; window.__MAGIC__.action.magicUnifyJsb.call = function (name, params) { if (window.__MAGIC__.action.magicUnifyJsb && window.__MAGIC__.action.magicUnifyJsb[name]) { return window.__MAGIC__.action.magicUnifyJsb[name](params); } if (window.__MAGIC__.action.jsb && window.__MAGIC__.action.jsb.app && window.__MAGIC__.action.jsb.app[name]) { return window.__MAGIC__.action.jsb.app[name](params); } console.log(‘JSB ‘ + name + ‘ is not defined.’); }}catch(e){ console.error(‘action Error’,e.message) } // state and tool do not need to inject. ]]>

Source

Leave a Reply

Close Menu
×
×

Cart