mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-01 00:02:21 +09:00
Separate device type (android/ios) from token type (fcm/apns)
애플 기기에서도 FCM을 사용하여 푸시알림을 구현할 수 있으므로 디바이스의 운영체제와 무관하게 토큰 타입을 지정하도록 변경합니다. 기존에 등록된 토큰은 운영체제 및 포맷에 따라 자동 변환합니다.
This commit is contained in:
parent
61f6456b6c
commit
ed7add6d9c
6 changed files with 39 additions and 30 deletions
|
|
@ -200,6 +200,8 @@ class member extends ModuleObject {
|
|||
if(!$oDB->isIndexExists('member_nickname_log', 'idx_after_nick_name')) return true;
|
||||
if(!$oDB->isIndexExists('member_nickname_log', 'idx_user_id')) return true;
|
||||
|
||||
if(!$oDB->isColumnExists('member_devices', 'device_token_type')) return true;
|
||||
|
||||
$config = ModuleModel::getModuleConfig('member');
|
||||
|
||||
// Check members with phone country in old format
|
||||
|
|
@ -372,6 +374,15 @@ class member extends ModuleObject {
|
|||
$oDB->addIndex('member_nickname_log', 'idx_user_id', array('user_id'));
|
||||
}
|
||||
|
||||
// Add device token type 2020.10.28
|
||||
if(!$oDB->isColumnExists('member_devices', 'device_token_type'))
|
||||
{
|
||||
$oDB->addColumn('member_devices', 'device_token_type', 'varchar', '20', '', true, 'device_token');
|
||||
$oDB->addIndex('member_devices', 'idx_device_token_type', array('device_token_type'));
|
||||
$oDB->query("UPDATE member_devices SET device_token_type = 'fcm' WHERE device_type = 'android' OR LENGTH(device_token) > 64");
|
||||
$oDB->query("UPDATE member_devices SET device_token_type = 'apns' WHERE device_type = 'ios' AND LENGTH(device_token) = 64");
|
||||
}
|
||||
|
||||
$config = ModuleModel::getModuleConfig('member');
|
||||
$changed = false;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue