User 1 (with camera) does not transfer to User 2 (without camera), if the camera is turned on for both - everything is OK - reactjs

Stack: Nextjs, expressjs, socket.io, WebRTC
I'm trying to build a video chat, at the moment everything works fine only if the second user joins and agrees to use the camera and has one at all.
Otherwise, the connection is established, a chat is available between two users, but user 2 does not receive the video stream of user 1.
I put this code on github for more clarity and a better understanding of what is happening.
Very big cosmic thanks for help!

You are calling createOffer without the "legacy" offerToReceive* constraints. Without these, if the user creating the offer does not have a camera they will only negotiate audio and not attempt to negotiate video.
See https://webrtc.github.io/samples/src/content/peerconnection/pc1/ for a sample using those options.

Related

Problems configuring Amazon Iot Button, 3 long blinking pattern

I have been configuring manually IotButton devices correctly for some weeks following the steps shown in https://docs.aws.amazon.com/iot/latest/developerguide/iot-gs.html, with the correct certificate and policy so I have been able to launch a Lambda function, but the last days I am not able to connect them.
I obtain 3 long red blink pattern after a white blink, so checking the faq page (https://aws.amazon.com/iotbutton/faq/?nc1=h_ls) it seems that there is a problem with the answer that the button receives from Aws, but I don't know how to check it.
I have tried to configure a new button with the app in a different account, in a clean environment, but I have the same result.
Any idea about what i'm doing wrong?
Thank you in advice.

How to implement push notifications in React Native when the app is closed

I'm studying React Native right now, and I'm trying to figure out how to enable the reception of Push Notifications even when the app is closed, just as Facebook does.
I'm a web developer, so I'm not used to mobile apps' "Manifest" logic. Where should I start from?
Thank you!
It seems that since you are a web developer, mobile app is not yet familiar with you. Actually, setting up push notification will require a few more official steps (differently on iOS and Android), and after everything is set, the push notification will happen between Apple server (or Google server) and smartphone's OS (which is iOS or Android), so the push notifications will come to the phone no matter what (without knowing/caring your app is opened or closed ^^)
In the programming code of our app, we can do our logics when the notifications come based on 2 cases: users is using the app or app is not running (not running means users are not using your app, and it is either staying awake in the background or users have exited it completely - e.g. pressing Home button twice on iPhone, and swiping the app away)
Actually, If you want your app to stay awake in the background, you can add some settings to the "manifest"-like files (of course differently on iOS & Android). However, my experiences taught me that keeping the app awake will encourage the users to complain and delete our app (my previous app's user once complained about his iPhone's battery was consumed greatly because of my app ^^)
If you really want to keep your app awake, you can set it in the settings, then in the push notifications' data, you can include extra parameters, and finally in the function of receiving push-notifications in your app, you can do anything with those parameters!
In short, you may just need to config push-notification properly for your app, and Apple/Google will do the rest, either your app is running in background or totally closed, it will receive the notifications. Hope you can find a good solution based on my explanation. If there's still something unclear, feel free to post here some more details on your needs, thanks!
This is the library I'm using with my previous react-native project: (they also have tutorial there ^^)
https://github.com/zo0r/react-native-push-notification
ADDED EXPLANATION: (based on author's needs):
The goal is: the user will register/login in the app, and will subscribe to some future events.
=> whenever users open the app, data will be sent to Apple/Google server to get a token, and you will use this token together with user's subscribe data to send all to your own push-server (you can use PHP or node.js server or whatever)
When an event gets updated a notif. should be sent to all the users who are going to that event. So a notif. aimed to certain users only.
=> like the above answer, data will be sent every time users open app (or change settings, you can do it in your logic of the app, because data will be kept your own push-server, which means on that server, you can even see user list, and can aim to certain users - it depends on what data will be sent to the users from the smartphone, but users may refuse inputting too much information like name, age or email, but it's up to your service's need ^^)
By clicking on it, the app will open and a certain page of the app (pre-existing) will be shown.
=> by default, when an notif. is clicked, the app will be opened for sure, and here once again, you can add extra parameters to the notifications (which is the landing page you need, then in the function of you app, just go there - but it may get extra logics for this. Besides, when to push notification, and which data should be pushed etc. will be controlled by your own server)
It seems like the most complicated part will be the "sending to certain users" one!
=> I explained this already, but you're right, actually it's complicated, because you need to create your own server with lots of API and logics based on your needs, and it need a few more steps (complicated one because you need to register many things with Apple & Google, then adding their Certificates into your own server etc.)
Hopefully you will achieve it, I suggest you play around and truly understand how push-notifications work first (for both sides - your own server and your application) - Good luck, though ^^

WebRTC ICE not connecting with flask-login

I've ported the WebRTC demo app to work with the flask framework.
the strange thing is that everything is working perfect when one of the users is not logged in.
but when I login both users, I don't get the onIceConnectionStateChanged = connected.
I don't see any connection between the two modules (I've kept the apprtc random number user)
any ideas ?
I assume you are testing this from Chrome. In Chrome you can type in "chrome://webrtc-internals" to get all of the info about your ICE connection and other webrtc related debug information. If you already know this, do you see that any errors on that page?
Couple of ideas:
1. Make sure that setLocalDescription or setRemoteDescription steps succeed on both clients.
2. Check and make sure that all of your ICE-related info(like STUN or TURN servers) are correctly specified.

Tracking email client opens

I am slowly making some progress on figuring out how Litmus (litmus.com/analytics) and some other companies actually track email opens by which Email Client the user is using.
I found this really cool article written a long time ago that basically helped me get a start to actually understanding what goes into just simply tracking opens.
http://webanalyticsinsight.wordpress.com/2010/03/04/how-to-track-email-open-rates/
I'm no developer but I'm assuming there must be some sort of get_browser() that would allow me to do this.
any push in the right direction would help, thanks.
It's done by inserting a small hosted image into each message that is sent. The URL to the location where the image is hosted is unique for each message, so this way the system can determine which messages have been opened (provided that the recipient's mail client is set to open hosted images).
See: http://ultrasmtp.com/resources/openedmessagealerts.php for more info.

feedback form for WP7 app

How would I go about implementing a feedback function on a windows phone 7 app? I've considered creating a form that sends an email with the data to an address I own, but I wonder if there is a better solution.
I personally think the simplest and best solution is to use EmailComposeTask to send the feedback via email.
You could either just put some questions/suggested text in the Body - or you could fill the Body in with some information from a SL form.
One of the advantages of the EmailComposeTask is you will definitely get their email address to reply to. Another advantage is that the feedback will work even when there isn't currently a network connection - it'll just get added to the outbox for later processing.
Well, I would create a webservice that can receive that data. It could be useful in case you have a backend system that can make some data statistics.
You can refer to that post that contains some code about data sending to a web service: WP7 app never exits BeginGetResponse and goes into the callback function
Regards.

Resources