Skip to content

Zalo KitZalo SDK cho React Native

Đăng nhập bằng Zalo, tự làm mới token và lấy thông tin người dùng. Dùng được cho app React Native CLI lẫn development build của Expo.

Zalo Kit

Cài đặt ​

sh
npm install react-native-zalo-kit
cd ios && pod install
sh
yarn add react-native-zalo-kit
cd ios && pod install
sh
npx expo install react-native-zalo-kit
# thêm plugin vào app.json, rồi chạy
npx expo prebuild

Sau đó tạo ứng dụng Zalo và làm theo hướng dẫn thiết lập cho Expo, iOS hoặc Android.

Đăng nhập và lấy thông tin người dùng ​

ts
import { getUserProfile, login } from 'react-native-zalo-kit';

await login();
const { id, name, picture } = await getUserProfile();

Chạy thử trên thiết bị ​

Đăng nhập Zalo trong app ví dụ trên Android
Android
Đăng nhập Zalo trong app ví dụ trên iOS
iOS

Phát hành theo giấy phép MIT.