承接 xsanisty/loginradius 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

xsanisty/loginradius

Composer 安装命令:

composer require xsanisty/loginradius

包简介

Login Radius PHP-SDK

README 文档

README

This is the composer friendly fork of https://github.com/LoginRadius/PHP-SDK

LoginRadius PHP SDK is a development kit that lets you integrate Social Login such as Facebook, Google, Twitter and over 20 more on a PHP website. The SDK also fetches user profile data and can be customized from your LoginRadius user account. Ex: social icon sets, login interface, provider settings, etc.

Installation

Just add "xsanisty/loginradius" : "dev-master" to "require" field in composer.json

Example Code

"require" : {
    "xsanisty/loginradius" : "dev-master"
}

Steps to call the library:

 1. On the code behind of callback page, create an object of LoginRadius class and pass secret key and the token.
 2. If success, call getData method to get user's profile data.
   [For Premium paid plans: You can call getData method to get Extended user profile data.]
   visit the link for more information to get list of data: https://www.loginradius.com/product/user-profile-data

Sample code for authentication and get basic profile data

PHP

session_start();
require_once __DIR__.'/../vendor/autoload.php';
use LoginRadius\LoginRadius;

$secret = 'your-login-radius-secret';

//save token in session
if(isset($_POST['token'])){
    $_SESSION['token'] = $_POST['token'];
}else{
    $_SESSION['token'] = isset($_SESSION['token']) ? $_SESSION['token'] : '';
}

$token = $_SESSION['token'];

$loginRadius = new LoginRadius($secret, $token);
$userData = $loginRadius->getData();

Advance features (for Paid customers only)

LoginRadius generate a unique session token, when user logs in with any of social network. The lifetime of LoginRadius token is 15 mins, get/Save this Token to call this API.

LoginRadius Contacts API

You can use this API to fetch contacts from users social networks/email clients - Facebook, Twitter, LinkedIn, Google, Yahoo.

PHP

$loginRadius->contact->getContacts();

LoginRadius Status API

PHP

//post status
$response = $loginRadius->status->postStatus(array(
	'to' => '',
	'title' => '',
	'url' => '',
	'imageurl' => '',
	'status' => '',
	'caption' => '',
	'description' => ''
));

if($response === true){
	echo 'Message posted successfully.'; }
elseif(isset($response->errormessage)){
	echo $response->errormessage;
}else{
	echo 'Error in message post.';
}

//get status
$status = $loginRadius->status->getStatus();

LoginRadius Posts API

You can use this API to get posts from users social networks - Facebook, Twitter, LinkedIn

PHP

//get posts
$posts = $loginRadius->post->getPosts();

Get Twitter Mentions

You can use this API to get mentions from users social network - Twitter.

PHP

$mentions = $loginRadius->status->getMentions();

Facebook Groups

You can use this API to get groups from users social network - Facebook.

PHP

$groups = $loginRadius->group->getGroups();

Get LinkedIn follow companies

You can use this API to get followed companies list from users social network - LinkedIn.

PHP

$companies = $loginRadius->company->getCompany();

LoginRadius direct message API

You can use this API to send direct message.

PHP

$response = $loginRadius->message->sendMessage($to,$subject,$message);
if($response === true){
		echo 'Message sent successfully.';
}elseif(isset($response->errormessage)){
		echo $response->errormessage;
}else{
		echo 'Error in sending message.';
}

统计信息

  • 总下载量: 67
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 38
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-10-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固