Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About RTM engine init and Message receive. #33

Open
jawang94 opened this issue Mar 18, 2021 · 22 comments
Open

About RTM engine init and Message receive. #33

jawang94 opened this issue Mar 18, 2021 · 22 comments
Assignees
Labels
duplicate This issue or pull request already exists

Comments

@jawang94
Copy link

jawang94 commented Mar 18, 2021

Hey there. I'm using agora-react-native-rtm to handle user join subscriptions for audio broadcasting. It works fine on simulator & my iPhone X on iOS 14 (the users list updates & all events are properly fired off). However, on my iPhone 12 Pro running iOS 14.4.1 the rtmEngine events fail to fire for seemingly no reason. They simply return a generic Error object w/ no message. rtcEngine works properly and I'm able to connect + hear audio coming from the iPhone 12 Pro, so just an rtmEngine issue here. Any ideas on what might be going wrong?

Errors (as you can see I tried logging the message and name of the first Error object but it doesn't contain any useful info):
Screen Shot 2021-03-17 at 5 20 52 PM

Initialize method for RTM:
Screen Shot 2021-03-17 at 5 25 54 PM

Here's a snippet of the startCall method. The first await for rtcEngine succeeds but the subsequent 3 awaits for rtmEngine fail (only on iPhone 12 Pro running iOS 14.4.1).
Screen Shot 2021-03-17 at 5 22 11 PM

P.S. agora-react-native-rtm is on version ^1.2.2-alpha.6 and react-native-agora is ^3.3.1.

Thanks!

@plutoless
Copy link
Collaborator

is the token null? have you turned on token?

@t3hfx
Copy link

t3hfx commented Mar 19, 2021

I have this issue on iPhone 11 14.4 too. I don't send token as soon as my app is in testing mode.
Just simple "Error" message.

@jawang94
Copy link
Author

Thanks yeah, I've tried with both a temp token (in testing mode) and a null token. Works on earlier iOS versions but not on newer versions. Again, I've only tested iOS 14.0 and 14.4.1 so I'm not sure at what version this may have started occurring. Is it working for you @plutoless ?

@RoJoHub
Copy link

RoJoHub commented Mar 22, 2021

Sorry to reply you so late
@t3hfx ,@jawang94

Currently our error object cannot be printed directly.

In the next release, we will improve the error code prompt information of our SDK.

Now. please use

catch((e)=>{
    console.log(‘code:',e.code);
})

Error code For login : LoginErrorCode

Error code For join channel: JoinChannelErrorCode

Error code For send message: SendMessageErrorCode


Please adjust the response code according to the error message

Hope this helps you

@jawang94
Copy link
Author

Yeah for whatever reason on the newer iOS versions logging into RTMEngine just returns Error Code 9 for timeout. Doesn't specify why. The other two return Error Code 102 due to not being logged in =/. Any ideas?

@RoJoHub
Copy link

RoJoHub commented Mar 31, 2021

@jawang94
Copy link
Author

jawang94 commented Mar 31, 2021

I could be wrong but I don't think it has to do with firewalls? This seems to be a problem only with iOS 14.4+. Logging in (both login() and loginV2())times out after 6s. Works on iOS 14.0. I'm not really sure what's wrong here. I set up server generated tokens too and I'm using those for both RTC and RTM now. RTC works, but not RTM. I'll keep trying things. Thanks for the help. Hopefully someone else is also having the same problem and can give more info.

@RoJoHub
Copy link

RoJoHub commented Mar 31, 2021

I could be wrong but I don't think it has to do with firewalls? This seems to be a problem only with iOS 14.4+. Logging in (both login() and loginV2())times out after 6s. Works on iOS 14.0. I'm not really sure what's wrong here. I set up server generated tokens too and I'm using those for both RTC and RTM now. RTC works, but not RTM. I'll keep trying things. Thanks for the help. Hopefully someone else is also having the same problem and can give more info.

Do you mean that iOS can't login by use rtm sdk?
In this case, you should follow this doc.
https://docs.agora.io/en/Real-time-Messaging/messaging_ios?platform=iOS#a-nameappidaget-an-app-id

@jawang94
Copy link
Author

jawang94 commented Mar 31, 2021

Yes, correct. This RTM SDK cannot login on iOS 14.4.1. I've tried on two separate iPhones. I can confirm it works on earlier iOS version (14.0.0). I'm familiar with the docs and followed the procedures properly. Can you verify that you are able to login to the RTM SDK on iOS version 14.4.1?

@RoJoHub
Copy link

RoJoHub commented Mar 31, 2021

Yes, correct. This RTM SDK cannot login on iOS 14.4.1. I've tried on two separate iPhones. I can confirm it works on earlier iOS version (14.0.0). I'm familiar with the docs and followed the procedures properly. Can you verify that you are able to login to the RTM SDK on iOS version 14.4.1?

Yes, I confirm that both my iPhone XS Max (14.4.1) and the simulator (14.4.1) will work.
Maybe you should create project without token on agora console?
WX20210331-140556@2x

@jawang94
Copy link
Author

Let me give that a try tomorrow! Thanks for the help. Seems to be my issue then for sure.

@jawang94
Copy link
Author

Yes, correct. This RTM SDK cannot login on iOS 14.4.1. I've tried on two separate iPhones. I can confirm it works on earlier iOS version (14.0.0). I'm familiar with the docs and followed the procedures properly. Can you verify that you are able to login to the RTM SDK on iOS version 14.4.1?

Yes, I confirm that both my iPhone XS Max (14.4.1) and the simulator (14.4.1) will work.
Maybe you should create project without token on agora console?
WX20210331-140556@2x

@RoJoHub It worked for me this morning! I'm not positive what fixed it but these are the changes I made.

  1. Update iOS to 14.4.2.
  2. Create project without token on Agora console.
  3. Completely remove app from device & clean XCode build folder, then rebuild onto device.

Thanks for your help everyone! I'll continue to monitor and try to understand what initially caused the problem.

@t3hfx
Copy link

t3hfx commented Mar 31, 2021

Can confirm that creating a project without token worked

@jawang94
Copy link
Author

Wondering how we might get the token to work since we'd probably want that in production.

@RoJoHub
Copy link

RoJoHub commented Apr 1, 2021

You may need to consult a backend.

@t3hfx
Copy link

t3hfx commented Apr 1, 2021

Yeah, can anybody confirm that they got it working on iOs 14.4 with token?

@jawang94 jawang94 reopened this Apr 1, 2021
@jawang94
Copy link
Author

jawang94 commented Apr 1, 2021

I have tried it with backend token generation as well as temp tokens via console, neither worked. Would also like to know if someone got it working on iOS 14.4+ w/ token.

@RoJoHub
Copy link

RoJoHub commented Apr 2, 2021

This involves the authentication mechanism, it is recommended to submit a ticket on the agora official website.

@RoJoHub RoJoHub closed this as completed Apr 2, 2021
@t3hfx
Copy link

t3hfx commented Apr 2, 2021

Why isn't it linked to agora-react-native-rtm library if it's not working with token only on iPhone 14.4? Android however works

@jawang94
Copy link
Author

jawang94 commented Apr 2, 2021

I would like to know that too. I did submit a ticket directly in the Agora console regarding implementation of token based RTM logins so I'll reply here with what they say.

@RoJoHub RoJoHub reopened this Apr 8, 2021
@RoJoHub RoJoHub changed the title Struggles on iOS 14.4.1 iPhone 12 Pro About RTM init and Message receive. Apr 8, 2021
@RoJoHub RoJoHub changed the title About RTM init and Message receive. About RTM engine init and Message receive. Apr 8, 2021
@RoJoHub RoJoHub added the duplicate This issue or pull request already exists label Apr 8, 2021
@RoJoHub RoJoHub pinned this issue Apr 8, 2021
@jawang94
Copy link
Author

jawang94 commented Apr 9, 2021

This has been resolved for me although I didn't necessarily do anything differently. Can't explain why it was happening before or how I managed to fix it. May want to leave this open to see if others experience the same issues :)

@t3hfx is yours still timing out?

@hdcaruth
Copy link

Any update here? I cannot login via token as described above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

5 participants