Line Emoji
Message Api只能使用官方提供的幾種Line Emoji, 雖然自己有畫但不能使用蠻切心的官方說明:https://developers.line.biz/en/docs/messaging-api/message-types/#text-messages
Line Emoji List:https://developers.line.biz/media/messaging-api/emoji-list.pdf
使用PHP要把UTF-32轉成UTF-8,實作時把它做成快速的function
class LINE{
public static function emoji($code){
$bin = hex2bin(str_repeat('0', 8 - strlen($code)) . $code);
$emoticon = mb_convert_encoding($bin, 'UTF-8', 'UTF-32BE');
return $emoticon;
}
}
測試:
$client->replyMessage([
'replyToken' => $event['replyToken'],
'messages' => [
[
"type"=> "text",
"text"=>"唉呦,是不是又在亂花錢?".LINE::emoji('100088')
]
]
]);
iOS Emoji
若要使用ios內建的emoji, 可以直接複製Emoji使用Emoji Copy: https://www.emojicopy.com/
測試:
$client->replyMessage([
'replyToken' => $event['replyToken'],
'messages' => [
[
"type"=> "text",
"text"=>"唉呦,是不是又在亂花錢?😭"
]
]
]);
留言 (0)
張貼留言