|
@@ -94,7 +94,7 @@ function createFlexMessageData() {
|
|
|
"altText": redistitle,
|
|
|
"contents": redisdata,
|
|
|
};
|
|
|
-
|
|
|
+ alert(`${flex}`)
|
|
|
return flex;
|
|
|
}
|
|
|
|
|
@@ -109,22 +109,16 @@ function shareTargetPicker() {
|
|
|
redistitle = data.title;
|
|
|
console.log(redistitle);
|
|
|
console.log(redisdata);
|
|
|
- alert('測試');
|
|
|
- alert(`redistitle: ${redistitle},redisdata: ${redisdata}`);
|
|
|
- // liff
|
|
|
- // .shareTargetPicker([
|
|
|
- // createFlexMessageData()
|
|
|
- // ])
|
|
|
- // .then(() => {
|
|
|
- // alert("Shared to the friend(s) you picked");
|
|
|
- // })
|
|
|
- // .catch(function (res) {
|
|
|
- // alert(res);
|
|
|
- // });
|
|
|
|
|
|
- liff.openWindow({
|
|
|
- url: `https://access.line.me/oauth2/v2.1/liff/shareTargetPicker?liffId=1657114132-lvaMW1wP&ott=NpQQmuPeYKY07A0gt12Ge2`, // URL for another LIFF app
|
|
|
- external: false
|
|
|
- });
|
|
|
+ liff.shareTargetPicker([
|
|
|
+ createFlexMessageData()
|
|
|
+ ])
|
|
|
+ .then(() => {
|
|
|
+ alert("Shared to the friend(s) you picked");
|
|
|
+ })
|
|
|
+ .catch(function (res) {
|
|
|
+ alert('發送錯誤', res);
|
|
|
+ });
|
|
|
+
|
|
|
});
|
|
|
}
|