SyuanYu 2 年之前
父節點
當前提交
d953a7cd48
共有 2 個文件被更改,包括 24 次插入8 次删除
  1. 23 7
      misa/js/liff-functions.js
  2. 1 1
      misa/js/liff-init.js

+ 23 - 7
misa/js/liff-functions.js

@@ -109,16 +109,32 @@ function shareTargetPicker() {
       redistitle = data.title;
       console.log(redistitle);
       console.log(redisdata);
+      console.log('測試');
 
+      /* Test */
       liff.shareTargetPicker([
-        createFlexMessageData()
+        {
+          type: "text",
+          text: "Hello, World!"
+        }
       ])
-        .then(() => {
-          alert("Shared to the friend(s) you picked");
+        .then(
+          console.log("ShareTargetPicker was launched")
+        ).catch(function (res) {
+          alert(res);
+          console.log("Failed to launch ShareTargetPicker", res)
         })
-        .catch(function (res) {
-          alert('發送錯誤', res);
-        });
+
+      // liff
+      // .shareTargetPicker([
+      //   createFlexMessageData()      
+      // ])
+      // .then(() => {
+      //   alert("Shared to the friend(s) you picked");
+      // })
+      // .catch(function(res) {
+      //   alert(res);
+      // });
 
     });
-}
+}

+ 1 - 1
misa/js/liff-init.js

@@ -2,7 +2,7 @@
 // Don't forget to change this to your LIFF ID
 
 // const liffId = "1657114132-2vvKr7Pe";
-const liffId = "1657114132-lvaMW1wP";
+const liffId = "1657114132-lvaMW1wP"; // MISA ID
 
 // Don't forget to change this to your LIFF ID