Roblox notification - notifications

So I wanted to make a notification on Roblox that sends the player who joined a notification with their profile picture and username like this
"Welcome username"
I don't know how to do lol

LocalScript goes into StarterPlayer > StarterPlayerScripts
local players = game:GetService("Players")
game:GetService("StarterGui"):SetCore("SendNotification", {
Title = "Weclome!";
Text = "Welcome, " .. players.LocalPlayer.DisplayName;
Icon = "rbxthumb://type=AvatarHeadShot&id=" .. players.LocalPlayer.UserId .. "&w=180&h=180 true";
Duration = 5
})

Related

File can not be attached to the Email when we try to send an email with Kotlin?

The following code is working while using Jetpack Kotlin.
But there is a little problem it can not attach pdf file.
When email button clicked opened view with Gmail and Drive icon at bottom shows
the pdf file name as test.pdf at top.
But when we choose gmail at bottom everything filled correctly except test.pdf.
It is not attached to the email form and then can not be emailed.
Button(onClick = {
val i = Intent(Intent.ACTION_SEND)
i.type = "vnd.android.cursor.dir/email"
val emailAddress = arrayOf("testEmailAddress#gmail.com")
i.putExtra(Intent.EXTRA_EMAIL,emailAddress)
val name = FileWorks().createFileName(context = cx, dirName = "calc", fileName = "test.pdf")
val contentUri = name.toURI()
i.putExtra(Intent.EXTRA_STREAM, Uri.parse(name.toString()))
i.putExtra(Intent.EXTRA_SUBJECT,"subject")
i.putExtra(Intent.EXTRA_TEXT,"body")
i.setType("message/rfc822")
ctx.startActivity(Intent.createChooser(i,"Choose an Email client : "))
}

Deepstream 1 - n relation

I'm trying to build a user notification using Deepstream.io. I'm using deepstream.io-storage-mongodb for storage. My data structure:
User
=================
id - email - others
Notication
=================
userId - notification
I'm try to implement 1-n modelling deepsteam tutorial. But I can't understand how can I do this. How can I store pointer or how can I point towards a List ? Or how can I implement notification using deepstream ?
Thanks in Advance.
you can try as like as given below (I'm using JS):
Receive Notication
var client = deepstream( 'localhost:6020' );
client.login();
// Unique Identification for user
let uniqueId = `userId:${userId}`;
// Mongodb collection : Notification
statusRecord = client.record.getList("Notification/" + uniqueId);
statusRecord.subscribe(function(data) {
data.forEach(function(name) {
var record = client.record.getRecord(name);
record.whenReady(function(r) {
// all notification
console.log( "r ==> ", r.get() );
});
});
});
Send Notification
const ds = deepstream( 'localhost:6020' );
ds.login();
// userId
const list = this.ds.record.getList( `Notification/${userId}` );
// id for notification
let id = `Notification/${this.ds.getUid()}`;
let record = this.ds.record.getRecord(id);
record.set( {
message: 'information'// save notification data
});
list.addEntry(id);
Hope it will solve your problem.

Obj C - I can't find the user location via the Facebook Graph API

I'm building a iOS app with a Facebook login via the Facebook Graph API. So far the login works perfectly and I receive the users profile. I'm trying to display the location (place of residence, not his current location) of the user but can't seem to find it in the user data I get when the user is logging in.
This is the JSON I receive:
{
email = "";
"favorite_athletes" = (
{
id = 308994352528078;
name = "Belgian Falcon F16 Racing Team";
}
);
"first_name" = Bastiaan;
gender = male;
id = 10153090459134040;
"last_name" = Andriessen;
link = "https://www.facebook.com/app_scoped_user_id/10153090459134040/";
locale = "en_US";
name = "Bastiaan Andriessen";
timezone = 1;
"updated_time" = "2014-11-28T13:10:46+0000";
verified = 1;
}
The Facebook Docs says it does send the location with the profile but I as you can see I don't find it in the JSON:
https://developers.facebook.com/docs/reference/ios/current/protocol/FBGraphUser/
Does someone know how I could solve this?

Local notification in Android with Corona

I am trying to create 3 notifications with 10 seconds gap. However, It only plays the first sound and it repeats forever with 10 seconds gap. Can you please examine my code and tell me what I am doing wrong?
local futureTime = 10 --10 seconds
local sounds = {"Icebaby.mp3", "Pokemon.mp3", "Yoshi.mp3"}
i=1
local options = {
alert = "Wake up!",
sound = "Icebaby.mp3" ,
custom = { msg = "Alarm" }
}
local notificationID = system.scheduleNotification( futureTime, options )
local function notificationListener( event )
system.cancelNotification(notificationID)
i=i+1
options.sound=sounds[i]
if(i>3) then
Runtime:removeEventListener ( "notification", notificationListener )
else
notificationID = system.scheduleNotification( futureTime, options )
end
end
Runtime:addEventListener( "notification", notificationListener )
1st problem: "It only plays the first sound"
-> Yes, because you don't change the options table. So it's always this options table:
local options = {
alert = "Wake up!",
sound = "Icebaby.mp3" ,
custom = { msg = "Alarm" }
}
Change the options table each time you create the next notification. For example use your "sounds" table!

Retrieving email-id from database and send mail to them

In yii i am creating sendemail functionality. I am using mailer extension and its working correctly after making all settings of SMTP. i had made method actionEmail in controller as-
public function actionEmail()
{
$model=new User;
$mailer = Yii::createComponent('application.extensions.mailer.EMailer');
$mailer->IsSMTP();
$mailer->IsHTML(true);
$mailer->SMTPAuth = true;
$mailer->SMTPSecure = "ssl";
$mailer->Host = "smtp.gmail.com";
$mailer->Port = 465;
$mailer->CharSet = 'UTF-8';
$mailer->Username = "abc#gmail.com";
$mailer->Password = "abc";
$mailer->From = "xyz#gmail.com";
$mailer->FromName = "Balaee.com";
$mailer->AddAddress('shilpa.kirad#shailani.com');
$mailer->Subject = "welcome to Balaee";
$mailer->IsHTML(true);
// $html = $this->renderPartial('myview',array('content'=>'Hello World'),true);
$mailer->Body = "Welcomeclick on link for other detail ".$url="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
if($mailer->Send()) {
echo "Please check mail";
//Yii::app()->user->setFlash('register','Thank you for contacting us. We will respond to you as soon as possible.');
// $this->refresh();
}
else {
echo "Fail to send your message!";
}
}
This method is implementing correctly.It is sending mail to address which is mentioned in mailer->AddAdress.But now i want to retrive email id's from database corresponding to specific user's id and send mail to him. i.e.I dont want to insert hard coded value for this field. So how can i do this. Please help me.
for fetch use id of user to get email address as
$user_model=User::model()->findByPk($id);
and set in email as
$mailer->AddAddress($user_model->email_id);
where id and email_id are the table column name.
check other ways .
http://www.yiiframework.com/doc/guide/1.1/en/database.dao
For this to be done, you can fetch email id from database using following query:
$email = SELECT email FROM USER WHERE user_id = "X";
Here X is user_id of user whom you want to send email.
And provide this $email in the receipient's email field. Thanks.