Changeset 2781465
- Timestamp:
- 09/07/2022 03:35:28 PM (4 years ago)
- Location:
- tapchat
- Files:
-
- 37 added
- 4 edited
-
tags/1.0.3 (added)
-
tags/1.0.3/admin (added)
-
tags/1.0.3/admin/Walker_PageDropdown_Multiple_tapchat.php (added)
-
tags/1.0.3/admin/css (added)
-
tags/1.0.3/admin/css/select2.min.css (added)
-
tags/1.0.3/admin/js (added)
-
tags/1.0.3/admin/js/select2.min.js (added)
-
tags/1.0.3/admin/js/socket.io.min.js (added)
-
tags/1.0.3/admin/js/tapchat-admin.js (added)
-
tags/1.0.3/admin/js/tapchat-admin.min.js (added)
-
tags/1.0.3/admin/tapchatAdmin.php (added)
-
tags/1.0.3/admin/templates (added)
-
tags/1.0.3/admin/templates/tapchat-call-history.php (added)
-
tags/1.0.3/assets (added)
-
tags/1.0.3/assets/css (added)
-
tags/1.0.3/assets/css/input.css (added)
-
tags/1.0.3/assets/css/tapchat.css (added)
-
tags/1.0.3/assets/images (added)
-
tags/1.0.3/assets/images/icon.png (added)
-
tags/1.0.3/assets/images/public-icon.png (added)
-
tags/1.0.3/includes (added)
-
tags/1.0.3/includes/class-tapchat-activator.php (added)
-
tags/1.0.3/includes/class-tapchat-api.php (added)
-
tags/1.0.3/includes/class-tapchat.php (added)
-
tags/1.0.3/public (added)
-
tags/1.0.3/public/assets (added)
-
tags/1.0.3/public/assets/images (added)
-
tags/1.0.3/public/assets/images/default.png (added)
-
tags/1.0.3/public/assets/js (added)
-
tags/1.0.3/public/assets/js/tapchat-public.js (added)
-
tags/1.0.3/public/assets/js/tapchat-public.min.js (added)
-
tags/1.0.3/public/tapchatPublic.php (added)
-
tags/1.0.3/public/templates (added)
-
tags/1.0.3/public/templates/tapchat.php (added)
-
tags/1.0.3/public/templates/tapchat_icon.php (added)
-
tags/1.0.3/readme.txt (added)
-
tags/1.0.3/tapchat.php (added)
-
trunk/includes/class-tapchat-api.php (modified) (1 diff)
-
trunk/includes/class-tapchat.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/tapchat.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
tapchat/trunk/includes/class-tapchat-api.php
r2778404 r2781465 345 345 346 346 function savePushToken($request){ 347 348 $pushToken = $request['pushToken']; 349 $playerId = $request['userId']; 350 $deviceSerial = $request['deviceSerial']; 351 352 if($request['wpUserID']){ 353 354 $wpUserID = $request['wpUserID']; 355 356 357 $playerIds = get_user_meta($wpUserID, 'os_playerid', true); 358 $deviceIds = get_user_meta($wpUserID, 'device_id', true); 359 $pushtoken = get_user_meta($wpUserID, 'os_pushtoken', true); 360 361 $pushNotificationData = array(); 362 $savePlayerIds = array(); 363 if(!is_array($playerIds)){ 364 if(!empty($playerIds)){ 365 $pushNotificationData[] = array('deviceId'=>$deviceIds,'playerId'=>$playerIds,'pushtoken'=>$pushtoken); 366 $savePlayerIds[] = $playerIds; 367 } 368 } 369 $pushNotificationData[] = array('deviceId'=>$deviceSerial,'playerId'=>$playerId,'pushtoken'=>$pushToken); 370 $savePlayerIds[] = $playerId; 371 372 update_user_meta($wpUserID, 'os_playerid', $savePlayerIds); 373 update_user_meta($wpUserID, 'os_push_notification_data', $pushNotificationData); 374 375 wp_send_json(array("status"=>'onsignal-saved','message'=>'Onesignal token data saved to wordpress.')); 376 347 $response = array('code'=>"auth_error",'message'=>"Fail to authanticate."); 348 if(empty($_SERVER['HTTP_TC_ACCESS_TOKEN'])){ 349 wp_send_json($response); 350 exit; 351 } 352 353 $this->get_tapchat_admin($request); 354 if(!$this->userId){ 355 wp_send_json(array('code'=>'invalid_request','message'=>"Invalid Operator Request!")); 356 exit; 357 } 358 359 $deviceSerial = $request['deviceToken']; 360 361 if(!empty($deviceSerial)){ 362 update_user_meta($this->userId,'_tap_chat_oprator_token',$deviceSerial); 363 $response = array('message'=>"Token saved."); 377 364 }else{ 378 379 wp_send_json(array("status"=>'user-missing','message'=>'Wordpress user not found.')); 380 381 } 365 $response = array('code'=>"missing_param",'message'=>"Required Parameter missing."); 366 } 367 wp_send_json($response); 382 368 exit; 383 369 } -
tapchat/trunk/includes/class-tapchat.php
r2736956 r2781465 132 132 if($send_notification){ 133 133 // push Notification 134 $device_token = get_user_meta($operator_id,'_tap_chat_oprator_token',true); 135 if($device_token){ 136 $api_id = $this->options['api_key']; 137 $args = array( 138 'headers' => array('Accept' => 'application/vnd.hmrc.1.0+json', 139 'Authorization' => 'Bearer '.$api_id 140 ), 141 'body' => array( 142 'token' => $device_token, 143 ), 144 ); 145 $resp = wp_remote_post( 'https://dashboard.tapchat.me/api/call/send-push-notification', $args ); 146 147 $data = json_decode(wp_remote_retrieve_body($resp)); 148 149 $response["notification_status"] = $data; 150 151 } 134 152 } 135 153 } -
tapchat/trunk/readme.txt
r2778564 r2781465 5 5 Tested up to: 6.0.2 6 6 Requires PHP: 7.2 7 Stable tag: 1.0. 27 Stable tag: 1.0.3 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 53 53 == Changelog == 54 54 = 1.0.2 = 55 * update Mobile push notification 56 = 1.0.2 = 55 57 * update Mobile API 56 58 = 1.0.1 = -
tapchat/trunk/tapchat.php
r2778404 r2781465 4 4 * Plugin URI: https://tapchat.me/ 5 5 * Description: This pluin provide an integration between tapchat Mobile App 6 * Version: 1.0. 27 * Stable tag: 1.0. 26 * Version: 1.0.3 7 * Stable tag: 1.0.3 8 8 * Author: Phillip Dane 9 9 * Author URI: https://www.linkedin.com/in/phillipdane/
Note: See TracChangeset
for help on using the changeset viewer.