ruiishiguro / smack

0 stars 0 forks source link

APPのダウンロードボタンのリンク出し分け #5

Open ruiishiguro opened 2 years ago

ruiishiguro commented 2 years ago

appleかそれ以外かでリンク先を変更出来るか検証 出来なければダウンロード先の選択をモーダルで表示させます。

ruiishiguro commented 2 years ago

1時間調べてみてください。

ruiishiguro commented 2 years ago

@Sayuri-Y これでOSの条件判定が出来るかも。

https://qiita.com/TD12734/items/671064e8fce75faea98d

Sayuri-Y commented 2 years ago

@ruiishiguro

ありがとうございます! 送っていただいたリンクを参考にやってみますー!

Sayuri-Y commented 2 years ago

@ruiishiguro

apple の時には 英語サイト、それ以外は日本語サイトに飛ぶように現状設定してみました。 apple 以外のデバイスで確認できてないのでアレですが、多分大丈夫なはず。。。!

https://smack.gmprojects.dev/

ruiishiguro commented 2 years ago

@Sayuri-Y ありがとうございます。 こちら実機で確認してご連絡差し上げますー。

ruiishiguro commented 2 years ago

リンク先をクライアントに確認する

Sayuri-Y commented 2 years ago

@ruiishiguro

共有しておらずすみません。。。! index.js の下記の部分がリンク出しわけの記述になっております! よろしくお願いいたします!

var link = function link() {
  var ua = window.navigator.userAgent.toLowerCase();
  var target = document.getElementById('device');

  if (ua.indexOf('iphone') !== -1) {
    target.href = 'https://www.placy.city/en/';
  } else if (ua.indexOf('ipad') !== -1 || ua.indexOf('macintosh') !== -1) {
    target.href = 'https://www.placy.city/en/';
  } else if (ua.indexOf('mac os x') !== -1) {
    target.href = 'https://www.placy.city/en/';
  } else {
    target.href = 'https://www.placy.city/ja/';
  }

  var ua2 = window.navigator.userAgent.toLowerCase();
  var target2 = document.getElementById('device2');

  if (ua.indexOf('iphone') !== -1) {
    target2.href = 'https://www.placy.city/en/';
  } else if (ua2.indexOf('ipad') !== -1 || ua.indexOf('macintosh') !== -1) {
    target2.href = 'https://www.placy.city/en/';
  } else if (ua2.indexOf('mac os x') !== -1) {
    target2.href = 'https://www.placy.city/en/';
  } else {
    target2.href = 'https://www.placy.city/ja/';
  }
};