How to disable camera in amazon chime sdk meeting - reactjs

I'm creating a meeting using amazon chime sdk library (in reactjs), where I don't want the option to open the camera at all. When the meeting is created, I'm setting the video input to null:
meetingManager.meetingSession.audioVideo.chooseVideoInputDevice(null)
What is happening is that the browser is asking for permissions to use the camera, turn it on for a second, and then turn it off (when the chooseVideoInputDevice() is being called).
What I want is to never ask for the camera permission, is that possible?

You can try join meeting with DeviceLabels.None to achieve your goal.
import {
DeviceLabels,
useMeetingManager,
} from 'amazon-chime-sdk-component-library-react';
const meetingManager = useMeetingManager();
await meetingManager.join({
meetingInfo,
attendeeInfo,
deviceLabels: DeviceLabels.None, // here
});

Related

How do you stop using App Engine Flex Instance?

I'm using a free trial of Google Cloud and I'm almost halfway through the free credit. I don't know if I'm doing something wrong or if it just costs more than I expected, so I was looking at the pricing and realized I don't understand most of it. I'm just learning and having fun so I don't actually want to spend money (or at least not that much), so anything to help make the free credits last the year would be great :)
https://firebase.google.com/pricing/
What I did with my function is get information from Firebase Database for notifications and then send the notification using Firebase Messaging. Here's the code, if it helps.
'use strict';
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp(functions.config().firebase);
exports.sendNotifications = functions.database.ref('/Notifications/{pushID}/title')
.onWrite(event => {
if (!event.data.exists())
return;
event.data.ref.parent.once('value').then(function(dataSnapshot){
// Grab the eventName and the message
const title = dataSnapshot.child('title').val();
const message = dataSnapshot.child('message').val();
const recipients = dataSnapshot.child('recipients').val();
const tag = dataSnapshot.child('tag').val();
const payload = {
notification:{
title: title,
body: message,
tag: tag,
color: "#51E0F5",
sound: 'default'
},
};
const options = {
priority: 'high',
collapseKey: 'chat',
timeToLive: 3600 // 6 days
};
// Get rid of this Notification in Firebase
event.data.ref.parent.remove();
// Create notification
if (recipients != null)
{
return admin.messaging().sendToDevice(recipients, payload, options);
}
else
{
return;
}
});
})
According to the transactions, I used
App Engine Flex Instance RAM: 1932.033 Gibibyte-hours
App Engine Flex Instance Core Hours: 1932.033 Hours
How do I stop using App Engine Flex Instance? What is it? Or is it time to look for a replacement before they start charging my card.
Thank you!
You can stop all instances in flexible app engine by stopping the VERSION. I use this all the time for development - no sense in keeping things running overnight.
Go to your google cloud platform console, select app engine, then select version. Check the version you want to stop, and then click stop at the top. Note that you can't actually DELETE your last version, but you CAN stop it :) This shuts down all instances.
you cannot stop the App Engine Flexible Instance. You will always have one instance running.
Please have a look at the following post
Google Appengine: Budget and Daily Spending Limit not Working
This question is also related to billing and pricing of appengine
Regards
Michael

how to store login information using onsen ui?

I want to use onsen ui and angularjs to develop a hybird application, but now I meet a problem, this application cannot store user's login information, so user must login everytime after they close the application.
I use $cookies, service, and $rootScope to store user's login information, but all of them can not work at android platform.
Anyone can help me to solve this problem?
On HTML5 mobile framework like Onsenui, I suggest to use localStorage.
You can take a look at these two AngularJs modules:
angular-local-storage
ngStorage
They have very well written instructions and demo codes as references.
use this plugin https://github.com/litehelpers/Cordova-sqlite-storage or something similar to create a sqlite database. Create a table with the information you want to keep (username and password). You can create a hash of the password and store it for better security (md5 or sha1).
You can also keep the timestamp of the login and keep the user logged in for a specific interval of time, so when he opens the app, check if you are inside this interval (e.g. day, week, etc.) from the last login and if yes, log him in automatically else show the login screen again.
if (window.localStorage.getItem("rememberMe") == "true") {
$scope.userEmail = window.localStorage.getItem("userName");
$scope.userPassword = window.localStorage.getItem("password");
document.getElementById("rememberMe").checked = true;
}
else {
document.getElementById("rememberMe").checked = false;
}
if (document.getElementById("rememberMe").checked == true) {
window.localStorage.setItem("rememberMe", "true");
window.localStorage.setItem("userName", $scope.userEmail);
window.localStorage.setItem("password", $scope.userPassword);
}
else if (document.getElementById("rememberMe").checked == false) {
window.localStorage.setItem("rememberMe", "false");
window.localStorage.setItem("userName", "");
window.localStorage.setItem("password", "");
}
Hi! have a look at the above code. It stores in local storage

How to validate if the Google Plus profile exists?

I have combined Admin SDK Directory API with the Google+ Domains API to fetch all the Google plus profile information.
But , There are people who do not have Google Plus profile in our organization which generates a null pointer Exception,I also tried the below code to validate
Person profile = plus.people().get(directorylist.getId()).execute();
if(!profile.isEmpty())
{
System.out.println(profile.getDisplayName());
profile.getImage().getUrl();
profile.getSkills();
System.out.println("SKILL="+profile.getSkills());
System.out.println("ORG="+profile.getOrganizations());
}
But the validation is not working and it is throwing null pointer Exception . Let me know if anyone has a better solution to this problem
You want:
public abstract boolean isPlusUser()
source

way to script an export of all AD users vcards

i'm looking for an easy way to export all active directory users info into unique vcards for each. there is some info i'd like to leave out of the vcard like home phone, and emergency contact. i've looked around the web and have little luck finding anything. any help would be appreciated.
I doubt there will be a very easy way. Ultimately, you need to
enumerate all your users (or a subset therefore)
iterate over the resulting list of users
export each user's data to a VCard
For the searching & iterating part, you can use a PrincipalSearcher to do your searching:
// create your domain context
using (PrincipalContext ctx = new PrincipalContext(ContextType.Domain))
{
// define a "query-by-example" principal - here, we search for a UserPrincipal
// this "QBE" user would give you the ability to further limit what you get back
// as results from the searcher
UserPrincipal qbeUser = new UserPrincipal(ctx);
// create your principal searcher passing in the QBE principal
PrincipalSearcher srch = new PrincipalSearcher(qbeUser);
// find all matches
foreach(var found in srch.FindAll())
{
UserPrincipal foundUser = found as UserPrincipal;
if(foundUser != null)
{
ExportToVCard(foundUser);
}
}
}
And now all that's left to do is create the ExportToVCard function :-) See e.g. this blog post with code samples and further links for help.
If you haven't already - absolutely read the MSDN article Managing Directory Security Principals in the .NET Framework 3.5 which shows nicely how to make the best use of the new features in System.DirectoryServices.AccountManagement. Or see the MSDN documentation on the System.DirectoryServices.AccountManagement namespace.
If you just want the data itself, I would take a look at Softerra's free LDAP Browser, found here.
Setup a profile for your directory server - once it's connected in the browser, you'll see the default schema for the BaseDN you've provided during the initial setup. On the server icon, right click, and hit "Export Data".
The export wizard will walk you through most of the process, but the important part is Step 3. If you want to find all users, just set your search filter to (objectClass=user), make sure your search scope is SubTree, and then then edit what attributes you want to return.
You'll have to process the results into VCards, but this is the easiest\fastest way of getting all the users and attributes that you want.

ACAccount Facebook: An active access token must be used to query information about the current user

I am using iOS 6 Social framework for accessing user's Facebook data. I am trying to get likes of the current user within my app using ACAccount and SLRequest. I have a valid Facebook account reference of type ACAccount named facebook, and I'm trying to get user's likes this way:
SLRequest *req = [SLRequest requestForServiceType:SLServiceTypeFacebook requestMethod:SLRequestMethodGET URL:url parameters:nil];
req.account = facebook;
[req performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) {
//my handler code.
}
where url is #"https://graph.facebook.com/me/likes?fields=name"; In my handler, I'm getting this response:
{
error = {
code = 2500;
message = "An active access token must be used to query information about the current user.";
type = OAuthException;
};
}
Shouldn't access tokens be handled by the framework? I've found a similar post Querying Facebook user data through new iOS6 social framework but it doesn't make sense to hard-code an access token parameter into the URL, as logically the access token/login checking should be handled automatically by the framework. In all examples that I've seen around no one plays with an access token manually:
http://damir.me/posts/facebook-authentication-in-ios-6
iOS 6 Facebook posting procedure ends up with "remote_app_id does not match stored id" error
etc.
I am using the iOS6-only approach with the built in Social framework, and I'm not using the Facebook SDK. Am I missing something?
Thanks,
Can.
You need to keep a strong reference to the ACAccountStore that the account comes from. If the store gets deallocated, it looks like it causes this problem.
Try running on an actual device instead of a simulator. This worked for me.
Ensure that your bundle id is input into your Facebook app's configuration. You might have a different bundle id for your dev/debug build.

Resources