Development/Error

[error] stomp/stompjs 안드로이드 연결 안됨...

mefd 2025. 4. 7. 08:08
728x90

디버그로 찍어보면 이렇게만…

 

ios 정상적으로 연결

 

구글 검색 다 해보고

androidManifest.xml 파일에 

          android:usesCleartextTraffic="true"

          <uses-permission android:name="android.permission.INTERNET" />

코드도 다 적용되어 있는데도 안됨…😂😂

 

혹시 몰라서 Client.d.ts 에서 속성들을 하나씩 살펴보았다.
...

forceBinaryWSFrames....!!!!

속성을 지정할 수 있다고 나왔다!

 

내 코드는 아래와 같은데,

  const client = new Client({

    brokerURL: 내 url,

    forceBinaryWSFrames: true,     //이거 추가

    onConnect: () => {

      console.log('Connected ======>', Platform.OS);

    },

    debug: str => {

      console.log('**DBUG:\n', str); // 디버그 메시지 출력

    },

  });

 

코드를 추가했고, 다시 테스트....!

 

연결 성공!!

728x90