ã¡ãã»ã¼ã¸ã³ã°SDK
React Native
æ¦è¦
agora.ioã«ReactNativeç¨ã®Real-time Messaging SDKãå ¬éããã¦ãã¾ãã
Agora Real-time Messaging SDKã¯ãããã¹ããã¼ã¿ããªã¢ã«ã¿ã¤ã ã«éåä¿¡ã§ããSDKã§ãããã¯ãã®ReactNativeç¨ã©ããã¼ã«ãªãã¾ãã
ãã®è¨äºã§ã¯ãµã³ãã«ã½ã¼ã¹ã«ä»å±ãã¦ããexampleã¢ããªãç¨ãã¦ããã®ãã«ãã¨ä½¿ãæ¹ããç´¹ä»ãã¾ãã
ãªããAgora Video SDKã®ReactNativeç¨ã©ããã¼ã«ã¤ãã¦ãå ¬éããã¦ãã¾ãã®ã§ã¯ã¤ãã¯ã¹ã¿ã¼ãã¬ã¤ãã¯ãã¡ãããåç §ãã ããã
ãµã³ãã«ã½ã¼ã¹
ãµã³ãã«ã½ã¼ã¹ã¯ä»¥ä¸ãããã¦ã³ãã¼ããã¦ãæºåãã ããã
ReactNativeç¨Real-time Messaging SDKãµã³ãã«
ã¾ãããã®è¨äºã§å©ç¨ããexampleã¢ããªã¯ãä¸è¨ãµã³ãã«ã®/exampleãã©ã«ã以ä¸ã«ããã¾ãã
使ç¨æ¹æ³
ãã«ãæ¹æ³ãåä½ç¢ºèªã«ã¤ãã¦ã説æãã¾ãã
ãã«ãæ¹æ³
1.ãµã³ãã«ã½ã¼ã¹ããã¦ã³ãã¼ã
2.ãã¡ã¤ã«ã®å±é
3.utils.tsã«APP IDã追è¨
examples/chatsappé
ä¸ã«ç§»åããutils.tsãã¡ã¤ã«ãéãç·¨éãã¾ãã
(/example/chatsapp/src/utils.ts)
export const APP_ID = '***'
â»APP_IDã¯agora.ioã«ã¦çºè¡ãããIdããç¨æãã ãã
4.ããã¸ã§ã¯ãã®ã«ã¼ããã©ã«ã(/example/chatsapp)ã¸ç§»å
5.ããã±ã¼ã¸ã®è¿½å
$ npm install --save agora-react-native-rtm
$ react-native link agora-react-native-rtm
6.å®æ©(Android)ã¨PCãUSBæ¥ç¶
7.å®æ©ãã«ã
$ react-native run-android --deviceId ***
8.ã¢ããªèµ·å
åæç»é¢
åä½ç¢ºèª
ãã«ããå®äºããã®ã§åä½ç¢ºèªããã¾ãã
â»åæºåã¨ãã¦ã対åæ ç¹ãå¿
è¦ã¨ãªããããReal-time-Messaging SDKã®ãã¦ã³ãã¼ããµã¤ãã«ã¦ã
WebRTCç¨Real-time-Messagingãµã³ãã«ã¢ããªããã¦ã³ãã¼ããã¦ãæºåãã ããã
(Real-time-Messaging SDKã®"Web vx.x.x"ãã¿ã³ãã¯ãªãã¯)
ï¼æ³¨ï¼å©ç¨ããã«ã¯node.jsãnpmãå¿
è¦ã¨ãªãã¾ãã
ï¼ãã1å°Androidããã¤ã¹ããæã¡ã§ãããããã®ããã¤ã¹ã«ReactNativeã¢ããªãã¤ã³ã¹ãã¼ã«ãã¦å¯¾åæ ç¹ã¨ãã¦ããã ããã®ãããããã¨æãã¾ãï¼
1.ReactNativeã¢ããªèµ·å&join
ReactNativeã¢ããªãèµ·åå¾ã
Channel nameã«"demo"ãå
¥åãã"Join Channel"ãã¯ãªãã¯ãã¾ãã
(Joinå¾)
2.対åæ ç¹ã¢ããªèµ·å&ãã°ã¤ã³
ç¨æãã¦ããã対åæ ç¹ã¨ãªããµã³ãã«ã¢ããªãèµ·åãã¾ãã
(npm installãnpm run devã«ã¦ãã©ã¦ã¶èµ·å(localhost:8080))
AppIdã®å
¥åãAccountNameã«âwebâãå
¥åãã"Login"ãã¯ãªãã¯ãã¾ãã
3.(対åæ ç¹ã¢ããª)Channelã«join
Channel nameã«"demo"ãå
¥åãã"Join"ãã¯ãªãã¯ãã¾ãã
4.(ReactNativeã¢ããª)ã¡ãã»ã¼ã¸ãéä¿¡
ReactNativeã¢ããªã«ã¦ãéä¿¡ã¡ãã»ã¼ã¸ã«"hello"ãå
¥åãã"Send"ãã¯ãªãã¯ãã¾ãã
対åæ ç¹ã¢ããªã«ã¦ã¡ãã»ã¼ã¸ãåä¿¡ã§ãã¦ãããã¨ã確èªãã¾ãã
5.(ReactNativeã¢ããª)ã¡ãã»ã¼ã¸ãåä¿¡
対åæ ç¹ã¢ããªã«ã¦Channel Message(éä¿¡ã¡ãã»ã¼ã¸)ã«"bye"ãå
¥åãã"SEND"ãã¯ãªãã¯ãã¾ãã
ReactNativeã¢ããªã«ã¦ã¡ãã»ã¼ã¸ãåä¿¡ã§ãã¦ãããã¨ã確èªãã¾ãã
ReactNativeã¢ããªã®ãã«ãããã³ã¡ãã»ã¼ã¸ã®éåä¿¡ãã§ãã¾ããã