This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useEffect } from 'react' | |
import Logo from './../assets/logo.png' | |
import { useNavigate } from 'react-router-dom' | |
import API from './../services/HttpClient' | |
// import { liff } from 'react-liff'; | |
import liff from '@line/liff' | |
// const liff = window.liff; | |
// const liffId = process.env.REACT_APP_LINE_LIFF_ID; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
LINE Example Webhook Group v.1 | |
*/ | |
/*Function Write File LOG*/ | |
file_put_contents('log.txt', file_get_contents('php://input') . PHP_EOL, FILE_APPEND); | |
/*Get Data From POST Http Request*/ | |
$datas = file_get_contents('php://input'); | |
/*Decode Json From LINE Data Body*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once __DIR__ . '/vendor/autoload.php'; | |
/*Get Data From POST Http Request*/ | |
$datas = file_get_contents('php://input'); | |
/*Decode Json From LINE Data Body*/ | |
$deCode = json_decode($datas,true); | |
$client = new MongoDB\Client( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'sendMessage.php'; | |
$flexDataJson = ''; | |
$flexDataJsonDeCode = json_decode($flexDataJson,true); | |
$datas['url'] = "https://api.line.me/v2/bot/message/push"; | |
$datas['token'] = "<access token>"; | |
$messages['to'] = "<user id>"; | |
$messages['messages'][] = $flexDataJsonDeCode; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'sendMessage.php'; | |
$datas = []; | |
$datas["type"] = "flex"; | |
$datas["altText"] = "This is a Flex Message"; | |
$datas["contents"]["type"] = "carousel"; | |
$datas["contents"]["contents"][0]["type"] = "bubble"; | |
$datas["contents"]["contents"][0]["header"]["type"] = "box"; | |
$datas["contents"]["contents"][0]["header"]["layout"] = "horizontal"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$getParam = $_GET['liff_state']; | |
$paramUrlDecode = urldecode($getParam); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define('UPLOAD_DIR', 'tmp_image/'); | |
/*Get Data From POST Http Request*/ | |
$datas = file_get_contents('php://input'); | |
/*Decode Json From LINE Data Body*/ | |
$deCode = json_decode($datas,true); | |
file_put_contents('log.txt', file_get_contents('php://input') . PHP_EOL, FILE_APPEND); | |
$LINEDatas['token'] = "<YOUR-CHANNEL-ACCESS-TOKEN>"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$userId = "U1a81dc36b7c95042c6ee4718cd5a7c18"; | |
$LINEDatas['url'] = "https://api.line.me/v2/bot/profile/".$userId; | |
$LINEDatas['token'] = "<YOUR-CHANNEL-ACCESS-TOKEN>"; | |
$results = getLINEProfile($LINEDatas); | |
file_put_contents('log-profile.txt', $results['message'] . PHP_EOL, FILE_APPEND); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/*Get Data From POST Http Request*/ | |
$datas = file_get_contents('php://input'); | |
/*Decode Json From LINE Data Body*/ | |
$deCode = json_decode($datas,true); | |
file_put_contents('log.txt', file_get_contents('php://input') . PHP_EOL, FILE_APPEND); | |
$replyToken = $deCode['events'][0]['replyToken']; | |
$userId = $deCode['events'][0]['source']['userId']; |