This file contains hidden or 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> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0,viewport-fit=cover"> | |
<title>Listing files in Cloud Storage for Firebase</title> | |
<link rel="shortcut icon" href="favicon.ico"> | |
<style> | |
ul { list-style-type: none; padding:0 } | |
li { float: left; width:200px; height:232px; margin:8px; text-align:center; border:1px solid #ddd } |
This file contains hidden or 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
<script> | |
function shareMsg(i, thumbUrl) { | |
// Ensure before calling shareTargetPicker() | |
if (confirm(`Share photo ${i}?`)) { | |
// Get original image from Image Resizes of Firebase Extentions | |
const origitalUrl = thumbUrl.replace('%2Fthumbs', '').replace('_200x200', '') | |
// Call Share Target Picker feature | |
liff.shareTargetPicker([ |
This file contains hidden or 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
<script src="https://static.line-scdn.net/liff/edge/2/sdk.js"></script> | |
<script> | |
async function main() { | |
// LIFF Initialize | |
await liff.init({ liffId: "LIFF-ID" }) | |
// Support external browser openning | |
if (liff.isLoggedIn()) { | |
// Get user profile from LINE | |
const profile = await liff.getProfile() |
This file contains hidden or 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
<script> | |
async function getImageList(profile) { | |
// Define reference path in Cloud Storage for Firebase | |
const storage = firebase.storage() | |
const storageRef = storage.ref() | |
const listRef = storageRef.child(`photos/${profile.userId}/thumbs`) | |
// Get file list | |
let listImage = await listRef.listAll() |
This file contains hidden or 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> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0,viewport-fit=cover"> | |
<title>Listing files in Cloud Storage for Firebase</title> | |
<link rel="shortcut icon" href="favicon.ico"> | |
<style> | |
ul { list-style-type: none; padding:0 } | |
li { float: left; width:200px; height:232px; margin:8px; text-align:center; border:1px solid #ddd } |
This file contains hidden or 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-promise') | |
const admin = require('firebase-admin') | |
const UUID = require('uuid-v4') | |
const path = require('path') | |
const os = require('os') | |
const fs = require('fs') | |
admin.initializeApp() | |
const LINE_MESSAGING_API = 'https://api.line.me/v2/bot' |