maitrungduc1410 / react-native-zalo-kit

Zalo SDK implementation for React Native
MIT License
44 stars 11 forks source link

Share Photo by sendMessageByZalo #60

Closed vanhoang2012 closed 5 months ago

vanhoang2012 commented 1 year ago

How to add attachment with function sendMessageByZalo

hungcuongDev commented 1 year ago

Bạn cài thư viện này có build đc release không, mình cứ bị lỗi linked command failed

maitrungduc1410 commented 1 year ago

in sendMessage function you can pass in the URL of your attachment with link.

Zalo SDK doesn't support sending attachment directly as file

import { sendMessage } from 'react-native-zalo-kit'

const sendMessage = async () => {
  try {
    const friendId = 'friend_ID'
    const link = 'https://zing.vn'
    const message = 'Hello World'
    const data = await sendMessage(friendId, message, link)
    console.log(data)

    /*
      returns: {
        to: 'friend_ID'
      }
    */
  } catch (error) {
    console.log(error)
  }
}
maitrungduc1410 commented 11 months ago

Bạn cài thư viện này có build đc release không, mình cứ bị lỗi linked command failed

Mình build bình thường bạn ạ, bạn check lại xem nhé.