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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" /> | |
<!-- <meta http-equiv = "refresh" content = "0; url = line://app/1234567890-liffappid/path?id=xxx" /> --> | |
<title>Facebook to LINE LIFF Redirect</title> | |
</head> | |
<body> | |
<script> |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=0, shrink-to-fit=no" /> | |
<meta name="theme-color" content="#000000" /> | |
<title>TEST</title> | |
</head> |
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
liff.getFriendship().then(data => { | |
if (data.friendFlag) { | |
// something you want to do | |
} else { | |
// not friend or being blocked, force to add friend | |
window.location = 'https://line.me/R/ti/p/<OA_BASICID>' | |
} | |
}) |
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
const functions = require("firebase-functions"); | |
const request = require('request'); | |
const crypto = require('crypto'); | |
const config = { | |
agentId: functions.config().dialogflow.agent_id, | |
channelSecret: functions.config().line.channel_secret | |
} | |
function postToDialogflow(req) { |
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 * as cors from 'cors'; | |
import * as express from 'express'; | |
import Line from './line'; | |
class App { | |
private _basePathApi = ''; | |
public app: express.Application; | |
public line: Line | |
constructor() { |
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 { | |
Client, | |
middleware, | |
WebhookEvent, | |
MessageAPIResponseBase, | |
TextMessage | |
} from "@line/bot-sdk" | |
import { Request, Response } from 'express'; | |
const functions = require('firebase-functions'); | |
import DB from './firestore' |
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 { initializeApp, firestore } from "firebase-admin" | |
interface UserProfile { | |
displayName: string | |
statusMessage: string | |
userId: string | |
pictureUrl: string | |
allowNotification: boolean | |
} |
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 { StrictMode } from "react"; | |
import ReactDOM from "react-dom"; | |
import App from "./App"; | |
const rootElement = document.getElementById("root"); | |
ReactDOM.render( | |
<StrictMode> | |
<App /> | |
</StrictMode>, |