Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile-group
galaxy-iOS
Commits
92d9087e
Commit
92d9087e
authored
Apr 19, 2024
by
David黄金龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
推送相关的bug
parent
9209ab13
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
13 deletions
+35
-13
Applegate(JPush).swift
galaxy/galaxy/Applegate(JPush).swift
+35
-13
No files found.
galaxy/galaxy/Applegate(JPush).swift
View file @
92d9087e
...
@@ -24,15 +24,21 @@ extension AppDelegate: JPUSHRegisterDelegate {
...
@@ -24,15 +24,21 @@ extension AppDelegate: JPUSHRegisterDelegate {
// init Push
// init Push
// notice: 2.1.5 版本的 SDK 新增的注册方法,改成可上报 IDFA,如果没有使用 IDFA 直接传 nil
// notice: 2.1.5 版本的 SDK 新增的注册方法,改成可上报 IDFA,如果没有使用 IDFA 直接传 nil
//初始化极光推送服务,调用了本 API 后,开启 JPush 推送服务,将会开始收集上报 SDK 业务功能所必要的用户个人信息
//初始化极光推送服务,调用了本 API 后,开启 JPush 推送服务,将会开始收集上报 SDK 业务功能所必要的用户个人信息
// [JPUSHService setupWithOption:launchOptions appKey:appKey
// [JPUSHService setupWithOption:launchOptions appKey:appKey
// channel:channel
// channel:channel
// apsForProduction:isProduction
// apsForProduction:isProduction
// advertisingIdentifier:advertisingId];
// advertisingIdentifier:advertisingId];
#if DEBUG
let
isProduction
=
false
let
isProduction
=
false
#elseif TESTENV
let
isProduction
=
true
#else
let
isProduction
=
true
#endif
JPUSHService
.
setup
(
withOption
:
launchOptions
,
JPUSHService
.
setup
(
withOption
:
launchOptions
,
appKey
:
"c6a9e10575b85ee90f3e8afe"
,
appKey
:
"c6a9e10575b85ee90f3e8afe"
,
channel
:
""
,
channel
:
"
appStore
"
,
apsForProduction
:
isProduction
)
apsForProduction
:
isProduction
)
}
}
...
@@ -42,10 +48,26 @@ extension AppDelegate: JPUSHRegisterDelegate {
...
@@ -42,10 +48,26 @@ extension AppDelegate: JPUSHRegisterDelegate {
print
(
"deviceToken:
\(
deviceTokenStr
)
"
)
print
(
"deviceToken:
\(
deviceTokenStr
)
"
)
JPUSHService
.
registerDeviceToken
(
deviceToken
)
JPUSHService
.
registerDeviceToken
(
deviceToken
)
YHLoginManager
.
shared
.
deviceTokenModel
.
deviceToken
=
deviceTokenStr
YHLoginManager
.
shared
.
deviceTokenModel
.
deviceToken
=
deviceTokenStr
#if DEBUG
YHHUD
.
flash
(
message
:
deviceTokenStr
)
#elseif TESTENV
YHHUD
.
flash
(
message
:
deviceTokenStr
)
#else
#endif
}
}
//获取token 失败
//获取token 失败
func
application
(
_
application
:
UIApplication
,
didFailToRegisterForRemoteNotificationsWithError
error
:
Error
)
{
//可选
func
application
(
_
application
:
UIApplication
,
didFailToRegisterForRemoteNotificationsWithError
error
:
Error
)
{
//可选
print
(
"did Fail To Register For Remote Notifications With Error:
\(
error
)
"
)
print
(
"did Fail To Register For Remote Notifications With Error:
\(
error
)
"
)
#if DEBUG
YHHUD
.
flash
(
message
:
error
.
localizedDescription
)
#elseif TESTENV
YHHUD
.
flash
(
message
:
error
.
localizedDescription
)
#else
#endif
}
}
//点推送进来执行这个方法
//点推送进来执行这个方法
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment