Opentok hello world activity unable to join session - android

I am trying to run opentok helloworld application
using this opentalk_hello_world (please login on git to access that url).
I did everything as it was instructed in that url which I mentioned above but I was not able to run the app.
There are two queries:
on 4th point its said that "The first time the app runs, it prompts the user to allow the app to use the camera to stream live video." which i was never asked!
on 5th point its said that "Once the app connects to the OpenTok session, it publishes an audio-video stream, which is displayed onscreen. Then, the same audio-video stream shows up as a subscribed stream (along with any other streams currently in the session)."
I have created sessionid and tokenid and replaced them in the activity. When I run the app I get the following in the logcat
02-25 14:07:00.640: E/demo-hello-world(6421): session failed! com.opentok.android.OpentokException: Session Compatibility Mismatch - There was a mismatch with the session's capabilities. You're likely trying to connect Android to a P2P Flash session on the web.
can you guys let me know where I am going wrong ?

did you create your session id from your dashboard? When generating the session id, make sure that p2p is not enabled! Also, make sure your token has publisher role so you can stream video.

Related

How to resolve Flutter Agora RTC showing error code 110

Greetings to fellow developers,
I am working on a project where I have to display a functional video call between two users. For reference, I have been following this video https://www.youtube.com/watch?v=v9ngriCV0J0
which has given a step-by-step explanation for establishing a video call between two users.
However, the only issue is that the video is having a Firebase backend. Hence, whenever a caller creates a call model with sender and recipient Ids, the recipient immediately receives the same data and a call is established. Whereas, I am using Node/Express backend (manual API calls for updating fetching data) which makes it extremely difficult to receive the required call data from the receiver's end as soon as the caller sends it to the backend. Also, it will be inefficient to listen for fetching the call data the whole time.
I will be very grateful to all of you if you can help me find a working approach so that the receiver can fetch the required call data as soon as the caller creates it in the backend for establishing a video call from separate devices.
Here's my code
https://pastebin.com/AurJnG27
/***pubspec.yaml dependencies***/
dependencies:
flutter:
sdk: flutter
http: ^0.12.0+2
provider: ^4.3.3
socket_io_client: ^0.9.9
permission_handler: ^3.0.0
agora_rtc_engine: ^1.0.8
/***pubspec.yaml dependencies***/
Please let me know if any further information is required from my side. Any feedback for code improvisation (if you feel like it) is also very appreciated.
You're getting that error because of an incorrect or expired token that you might be using. Firstly, I will suggest shifting to the latest version of the Agora SDK and then build your application.
Now, if you're just testing out the platform then from your Agora dashboard you can go ahead and generate a new App ID and select the testing mode which will disable token. So in your joinChannel() method you can pass null for the token value.
But if your application is live or is in production then go ahead and select the secured mode from your Agora dashboard. Then you will have to generate a token server from a deployed server, you can read more about it here.
Now, coming to the Firebase part. You can actually make this process much simpler by using the Agora RTM SDK. Which allows you to send messages, through this you can send peer message about the call details and hence refer it while making a call. You can have a look at this blog which shows how you can use the RTM SDK to do the same: https://www.agora.io/en/blog/building-your-own-audio-streaming-application-using-the-agora-flutter-sdk/
If you're interested you can have a look at this sample code given here which will help you setup a proper video calling application.
I will also recommend you to join the Agora Slack Channel where you can get help from other Agora developers.

Disable user login from multiple devices at the sametime, in Ejabberd/XMPP

Environment:
Ejabberd Version : 16.04
Smack-android-4.1.0
I'm working on an Android chat application. Currently, same user credentials can be used login from multiple devices.
The current scenario is as follows:
1. User logs in into the app in device A
2. Using the same username and password, the user logs successfully into the app in device B
3. Now device A says, it is disconnected, but continue the chat in device B
However, according to the given requirement, it should behave like this:
1. User logs in into the app in device A
2. Using the same username and password, when the user tries to log in from device B, it should not allow it.
(Since he is already logged in from device A)
Would be glad to hear your solutions/ideas on this. Thanks in advance.
So I managed to resolve the problem using the option resource_conflict
According to Ejabberd Configuring Docs
The option resource_conflict defines the action when a client attempts
to login to an account with a resource that is already connected. The
option syntax is:
resource_conflict: setresource|closenew|closeold: The possible values
match exactly the three possibilities described in XMPP Core: section
7.7.2.2. The default value is closeold. If the client uses old Jabber Non-SASL authentication (XEP-0078), then this option is not respected,
and the action performed is closeold.
So open ejabberd.yml and add the following line to that file.
resource_conflict: closenew
Then restart the ejabberd server.
Now it will disallow the resource binding attempt of the newly connecting client and maintain the session of the currently connected client.
References:
https://www.rfc-editor.org/rfc/rfc6120#section-7.7.2.2
Read #rubycon's answer on this- https://stackoverflow.com/a/51860779/5361779
From XMPP spec:
"If there is already an active resource of the same name, the server MUST either (1) terminate the active resource and allow the newly-requested session, or (2) disallow the newly-requested session and maintain the active resource. Which of these the server does is up to the implementation, although it is RECOMMENDED to implement case #1."
More info here https://xmpp.org/rfcs/rfc3921.html#session
So your current scenario is a recommended one.
However, I have quickly checked for ejabberd src code and found it can be configured somehow (closeold -> closenew)
https://github.com/processone/ejabberd/blob/master/src/ejabberd_c2s.erl#L964
https://github.com/processone/ejabberd/blob/master/src/ejabberd_c2s.erl#L873
I'm not an Erlang specialist, but looks like it can be achieved by modifying the source code
If device B sets as resource one different than device A, both can be connected to the same account correctly. In your tests, device B sets the exact same resource than device A, and then ejabberd kicks the older session.
I see there's an option to limit the number of sessions an account can have active in the server. The problem is that it kicks the older session, but you would like to disallow the new login. See
https://docs.ejabberd.im/admin/configuration/#limiting-opened-sessions-with-acl

Square Web API for Android Kills App

I am unable to make a successful connection with the square reader via android request after following documentation found at https://docs.connect.squareup.com/articles/web-api-android
It seems straightforward, but the connection links end up crashing the app or causing it to restart without any error reporting or callback information sent to either S.browser_fallback_url or S.com.squareup.pos.WEB_CALLBACK_URI.
Sample link activated on dev server (127.0.0.1) is: intent:#Intent;action=com.squareup.pos.action.CHARGE;package=com.squareup;S.browser_fallback_url=http://localhost:8080/tb/square;S.com.squareup.pos.WEB_CALLBACK_URI=http://localhost:8080/tb/square;S.com.squareup.pos.CLIENT_ID=secret;S.com.squareup.pos.API_VERSION=v2.0;i.com.squareup.pos.TOTAL_AMOUNT=150;S.com.squareup.pos.CURRENCY_CODE=USD;S.com.squareup.pos.TENDER_TYPES=com.squareup.pos.TENDER_CARD,com.squareup.pos.TENDER_CARD_ON_FILE,com.squareup.pos.TENDER_CASH,com.squareup.pos.TENDER_OTHER;S.com.squareup.pos.REQUEST_METADATA=5a982466e7b46;S.com.squareup.pos.NOTE=This will be a note!;end
For the CLIENT_ID I was instructed to use Application ID found at https://connect.squareup.com/apps/
Firmware on Contactless, Chip reader is 2.9.36 which is connected to the android device via bluetooth.
--edit--
First time through
https://ibb.co/kSBUYH
https://ibb.co/fyUGDH
Second time through
https://ibb.co/duFZ0x
https://ibb.co/i1MUYH
To bring this out of the comments, the issue was missing the web callback URL being registered in the Square Developer Portal.
You want to be sure to register your callback URL(s)
In order for Square Point of Sale to accept a request from your website, Square needs to verify that you have registered a web callback URI for the application in the Application Dashboard.
First, go to the Application Dashboard, then click on the Point of Sale API tab of your application's settings. Under the Web section, specify your app's web callback URI under the corresponding field.
If your transaction does not succeed for any reason, you should be receiving a error back to you.

Android. Parse.com: Invalid Session Token

Please help!
Short question:
I try to login ParseUser with session token like this:
ParseUser.becomeInBackground(token);
It always goes ok on first login. But it always fails when I retry. I get "invalid session token" error. Session stays the same. Any other info on token is hidden.
Detailed question
I'am building app for parents and kids. It is suggested that 2 users start app on their (different) devices using one account (one ParseUser for various devices logged in at one time).
First a parent signs in on his devices. Then he generates QR-code with session token.
String token = ParseUser.getCurrentUser().getSessionToken();
Bitmap bitmap = encodeAsBitmap(token);
qrView.setImageBitmap(bitmap);
Kid's device reads this QR and logs in.
This procedure goes fine at first time. But if I log out kid's device and try to login by QR for the second time it fails with "invalid session token". It also fails when i try to login second kid's device.
When I delete session manually in parse-dashboard, I can log in kid's device with QR again but only for once.
I tried my best to find some solution here and on the other internet but I didn't succeed.
Dear expert-level developers, help me on this issue.
It seems that I figured it out.
Short answer:
In Parse.com dashboard go to Settings tab. On General tab go to "User Sessions" section. Switch off "Require revocable sessions" toggle.
Details:
Since march 2015 Parse.com started using revocable sessions. It means that when user logs out or session expires it becomes useless. So you have to log out and log in back to use your app as usual.
This is an important security issue. But in case like mine consider switching it off.
I think you problem has to do with Parse.com now using revocable session tokens, see http://blog.parse.com/announcements/announcing-new-enhanced-sessions/
Others are having similar issues here: https://groups.google.com/forum/#!topic/parse-developers/Knxl_MBVlLY
This means that the token is only valid during a session, that is, while the user is logged on the device. Once the user logs out, the session is destroyed together with the token.
Perhaps this could be considered a 'feature' in your app, as the parents can pose control over their kids access to the app. If they log out, so is their child(ren).
If this is too far from the intended usage scenario, you could consider adding third party login such as Auth0 or OAuth
https://auth0.com/docs/scenarios/parse
https://parse.com/tutorials/adding-third-party-authentication-to-your-web-app

How to get the Log and Crash data for android live app?

I have developed one android application. Now we are testing this application in production environment.
I have to track the below information with out depending on tester to share the log file,
Send Log file. May be Logcat data. Foe Example If any web service fails we need to write that into log file then same needs to be sent to the server or to given mail id.
If there is any crash in our app then we can get the stach track by using getDefaultUncaughtExceptionHandler then we need to send the stack trace info via mail or send it to web server.
Or else I can use any solution provider like Google Analytics, Crashlytics or else I can write the log data to text file. And then same to be sent via mail on a daily or weekly basis.
Help me on this.
It's about time you move to crashlytics https://try.crashlytics.com/ or critisism http://www.crittercism.com/ check it out, infact there is ton of other options out there
With a service like http://www.apteligent.com (Crittercism renamed to Apteligent), when looking at a crash, you'll be able to automatically see a log of: web service calls, network connectivity changes, changes to screen views, and app foreground/background events that led up to the crash without manually adding any additional logging to your app:
https://www.apteligent.com/2016/03/working-automatic-breadcrumbs/

Categories

Resources