Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

libai / fireflyReg

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Switch branch/tag
  • fireflyReg
  • share
  • js
  • common.js
Find file
Normal viewHistoryPermalink
common.js 2.12 KB
Newer Older
libai's avatar
测试
8e24e39a
 
libai committed a year ago
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
var ua = navigator.userAgent.toLowerCase();
var cityFlag = true;
 province =  ['北京', '天津', '河北', '山西', '内蒙古', '辽宁', '吉林','深圳','广州','杭州','苏州', '黑龙江', '上海', '江苏', '浙江', '安徽', '福建', '江西', '山东 ', '河南', '湖北', '湖南', '广东', '广西', '海南 ', '重庆', '四川', '贵州', '云南', '西藏', '陕西', '甘肃', '青海', '宁夏', '新疆', 'CHINA']
 for(var i=0;i<province.length;i++){
  if(returnCitySN["cname"].indexOf(province[i])>-1){
          cityFlag = false;
      }
 }


function browserRedirect() {
        var ua = navigator.userAgent.toLowerCase();
        var userAgent = navigator.userAgent;
        var cityStr = (navigator.language || navigator.browserLanguage).toLowerCase();
        if(!cityFlag || (cityStr.indexOf('zh')>=0&&cityStr=='zh-cn')){
        	 if (/android/.test(ua)) {
	            window.location.href="https://www.firefly.live/yhc.apk";
	        } else {
	        	window.location.href = 'https://apps.apple.com/us/app/firefire-live/id1632598421?l=zh';
	        }
        } else {
        	if (/android/.test(ua)) {
	           new OpenInstall({
				      appKey: "egro0h",
				      preferWakeup: true,
				      mask: function () {	
				          return '<div id="openinstall_shadow" class="shadow-img"><img src="images/share-img.png" alt=""></div>'
				      },
				      onready: function () {
				          var m = this, button = document.getElementById("iosDown");
				          m.schemeWakeup();
		              m.wakeupOrInstall();
		              return false;
				      }
					}, 'gf');
	        } else {
	        	
		        	new OpenInstall({
				      appKey: "ssvd7x",
				      preferWakeup: true,
				      mask: function () {	
				          return '<div id="openinstall_shadow" class="shadow-img"><img src="images/share-img.png" alt=""></div>'
				      },
				      onready: function () {
				          var m = this, button = document.getElementById("iosDown");
				          m.schemeWakeup();
		              m.wakeupOrInstall();
		              return false;
				      }
					}, 'iosyhczb');
	        }
        }
        
    }