Expo
Zalo Kit ships a config plugin, so Expo projects need no manual native edits.
Add the plugin
{
"expo": {
"plugins": [["react-native-zalo-kit", { "appId": "<YOUR_ZALO_APP_ID>" }]]
}
}Then generate the native projects with npx expo prebuild, or build with EAS. Expo Go is not supported because the Zalo SDK is native code; use a development build.
Options
| Option | Type | Description |
|---|---|---|
appId | string | Required. Your numeric Zalo App ID. |
Pass appId as a string
Zalo App IDs have 19 digits, more than a JSON number can hold exactly: 2451745039837416278 becomes 2451745039837416400. The plugin rejects numbers that lost precision.
What the plugin changes
Android
- adds the
zalokit_app_idstring resource; - adds the
com.zing.zalo.zalosdk.appIDmeta-data toAndroidManifest.xml; - adds
BrowserLoginActivitywith thezalo-<appId>scheme.
iOS
- sets
ZaloAppIDinInfo.plist; - adds
zalosdkandzaloshareexttoLSApplicationQueriesSchemes; - adds the
zalo-<appId>URL type; - makes
application(_:open:options:)inAppDelegatehand Zalo's callback URL to the SDK first. Both the SwiftExpoAppDelegate(SDK 53+) and the Objective-CAppDelegatetemplates are supported.
Running prebuild again is safe: nothing is duplicated, and the scheme is updated if appId changes.
Custom AppDelegate
If your AppDelegate has no application(_:open:options:) method, prebuild fails with an error that points to the iOS setup. Add the method and forward the URL as shown in the iOS setup, then run prebuild again; the plugin leaves an AppDelegate that already calls ZDKApplicationDelegate untouched.