消息通知开发

This commit is contained in:
zjx 2025-06-16 16:44:03 +08:00
parent 690f961812
commit cd6b6f7dcf
13 changed files with 372 additions and 6 deletions

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.usernotifications.service</string>
<key>NSExtensionPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).NotificationService</string>
</dict>
</dict>
</plist>

View File

@ -0,0 +1,67 @@
//
// NotificationService.swift
// NotificationService
//
// Created by on 2025/6/16.
//
import UserNotifications
class NotificationService: UNNotificationServiceExtension {
var contentHandler: ((UNNotificationContent) -> Void)?
var bestAttemptContent: UNMutableNotificationContent?
override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
self.contentHandler = contentHandler
bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent)
guard let bestAttemptContent = bestAttemptContent else {
contentHandler(request.content)
return
}
if let options = request.content.userInfo["fcm_options"] as? [String : Any],
let imageURLString = options["image"] as? String,
let imageURL = URL(string: imageURLString) {
downloadImage(from: imageURL) { attachment in
if let attachment = attachment {
bestAttemptContent.attachments = [attachment]
}
contentHandler(bestAttemptContent)
}
} else {
contentHandler(bestAttemptContent)
}
}
override func serviceExtensionTimeWillExpire() {
if let contentHandler = contentHandler, let bestAttemptContent = bestAttemptContent {
contentHandler(bestAttemptContent)
}
}
//
private func downloadImage(from url: URL, completion: @escaping (UNNotificationAttachment?) -> Void) {
let task = URLSession.shared.downloadTask(with: url) { (downloadedUrl, _, error) in
guard let downloadedUrl = downloadedUrl else {
completion(nil)
return
}
let tmpDir = FileManager.default.temporaryDirectory
let tmpFile = tmpDir.appendingPathComponent(url.lastPathComponent)
do {
try FileManager.default.moveItem(at: downloadedUrl, to: tmpFile)
let attachment = try UNNotificationAttachment(identifier: UUID().uuidString, url: tmpFile, options: nil)
completion(attachment)
} catch {
completion(nil)
}
}
task.resume()
}
}

View File

@ -158,6 +158,10 @@
BFCCE1242DFBF57B00EDE165 /* FirebaseCore in Frameworks */ = {isa = PBXBuildFile; productRef = BFCCE1232DFBF57B00EDE165 /* FirebaseCore */; }; BFCCE1242DFBF57B00EDE165 /* FirebaseCore in Frameworks */ = {isa = PBXBuildFile; productRef = BFCCE1232DFBF57B00EDE165 /* FirebaseCore */; };
BFCCE1262DFBF57B00EDE165 /* FirebaseMessaging in Frameworks */ = {isa = PBXBuildFile; productRef = BFCCE1252DFBF57B00EDE165 /* FirebaseMessaging */; }; BFCCE1262DFBF57B00EDE165 /* FirebaseMessaging in Frameworks */ = {isa = PBXBuildFile; productRef = BFCCE1252DFBF57B00EDE165 /* FirebaseMessaging */; };
BFCCE1282DFC080200EDE165 /* HWPanModalContentView+VPAdd.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFCCE1272DFC07FB00EDE165 /* HWPanModalContentView+VPAdd.swift */; }; BFCCE1282DFC080200EDE165 /* HWPanModalContentView+VPAdd.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFCCE1272DFC07FB00EDE165 /* HWPanModalContentView+VPAdd.swift */; };
BFCCE1342DFFFAB600EDE165 /* NotificationService.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = BFCCE12D2DFFFAB600EDE165 /* NotificationService.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
BFCCE13D2DFFFAC500EDE165 /* NotificationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFCCE13B2DFFFAC500EDE165 /* NotificationService.swift */; };
BFCCE1402E000ACE00EDE165 /* VPAnpsAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFCCE13F2E000ACE00EDE165 /* VPAnpsAlertView.swift */; };
BFCCE1422E000F4800EDE165 /* VPHomePlayHistoricalView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFCCE1412E000F4800EDE165 /* VPHomePlayHistoricalView.swift */; };
BFF5AFA42DE6F15E0044227A /* VPMeVipCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFF5AFA32DE6F15E0044227A /* VPMeVipCell.swift */; }; BFF5AFA42DE6F15E0044227A /* VPMeVipCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFF5AFA32DE6F15E0044227A /* VPMeVipCell.swift */; };
BFF5AFA62DE700420044227A /* VPMeVipPrivilegeItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFF5AFA52DE700420044227A /* VPMeVipPrivilegeItemView.swift */; }; BFF5AFA62DE700420044227A /* VPMeVipPrivilegeItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFF5AFA52DE700420044227A /* VPMeVipPrivilegeItemView.swift */; };
BFF5AFA82DE704DC0044227A /* VPMeCoinCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFF5AFA72DE704DC0044227A /* VPMeCoinCell.swift */; }; BFF5AFA82DE704DC0044227A /* VPMeCoinCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFF5AFA72DE704DC0044227A /* VPMeCoinCell.swift */; };
@ -235,6 +239,30 @@
F939C04AD4003BA127F15C28 /* Pods_Veloria.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 34F57E87E765BF8D72A43DCA /* Pods_Veloria.framework */; }; F939C04AD4003BA127F15C28 /* Pods_Veloria.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 34F57E87E765BF8D72A43DCA /* Pods_Veloria.framework */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
BFCCE1322DFFFAB600EDE165 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 1B056DEC2DDABE2B007EE38D /* Project object */;
proxyType = 1;
remoteGlobalIDString = BFCCE12C2DFFFAB600EDE165;
remoteInfo = NotificationService;
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
BFCCE1352DFFFAB600EDE165 /* Embed Foundation Extensions */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 13;
files = (
BFCCE1342DFFFAB600EDE165 /* NotificationService.appex in Embed Foundation Extensions */,
);
name = "Embed Foundation Extensions";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
1B056DF42DDABE2B007EE38D /* Veloria.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Veloria.app; sourceTree = BUILT_PRODUCTS_DIR; }; 1B056DF42DDABE2B007EE38D /* Veloria.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Veloria.app; sourceTree = BUILT_PRODUCTS_DIR; };
1B056E212DDAC0FD007EE38D /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; 1B056E212DDAC0FD007EE38D /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
@ -394,6 +422,11 @@
BFCCE11E2DFAD18000EDE165 /* VPGuideViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPGuideViewController.swift; sourceTree = "<group>"; }; BFCCE11E2DFAD18000EDE165 /* VPGuideViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPGuideViewController.swift; sourceTree = "<group>"; };
BFCCE1202DFBF33500EDE165 /* GoogleService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; }; BFCCE1202DFBF33500EDE165 /* GoogleService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
BFCCE1272DFC07FB00EDE165 /* HWPanModalContentView+VPAdd.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "HWPanModalContentView+VPAdd.swift"; sourceTree = "<group>"; }; BFCCE1272DFC07FB00EDE165 /* HWPanModalContentView+VPAdd.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "HWPanModalContentView+VPAdd.swift"; sourceTree = "<group>"; };
BFCCE12D2DFFFAB600EDE165 /* NotificationService.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = NotificationService.appex; sourceTree = BUILT_PRODUCTS_DIR; };
BFCCE13A2DFFFAC500EDE165 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
BFCCE13B2DFFFAC500EDE165 /* NotificationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationService.swift; sourceTree = "<group>"; };
BFCCE13F2E000ACE00EDE165 /* VPAnpsAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPAnpsAlertView.swift; sourceTree = "<group>"; };
BFCCE1412E000F4800EDE165 /* VPHomePlayHistoricalView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPHomePlayHistoricalView.swift; sourceTree = "<group>"; };
BFF5AFA32DE6F15E0044227A /* VPMeVipCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPMeVipCell.swift; sourceTree = "<group>"; }; BFF5AFA32DE6F15E0044227A /* VPMeVipCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPMeVipCell.swift; sourceTree = "<group>"; };
BFF5AFA52DE700420044227A /* VPMeVipPrivilegeItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPMeVipPrivilegeItemView.swift; sourceTree = "<group>"; }; BFF5AFA52DE700420044227A /* VPMeVipPrivilegeItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPMeVipPrivilegeItemView.swift; sourceTree = "<group>"; };
BFF5AFA72DE704DC0044227A /* VPMeCoinCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPMeCoinCell.swift; sourceTree = "<group>"; }; BFF5AFA72DE704DC0044227A /* VPMeCoinCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPMeCoinCell.swift; sourceTree = "<group>"; };
@ -483,6 +516,13 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
BFCCE12A2DFFFAB600EDE165 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */ /* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */ /* Begin PBXGroup section */
@ -490,6 +530,7 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
1B056E2A2DDAC0FD007EE38D /* Veloria */, 1B056E2A2DDAC0FD007EE38D /* Veloria */,
BFCCE13C2DFFFAC500EDE165 /* NotificationService */,
1B056DF52DDABE2B007EE38D /* Products */, 1B056DF52DDABE2B007EE38D /* Products */,
97790501CCBF987017A55C80 /* Pods */, 97790501CCBF987017A55C80 /* Pods */,
AEE348721F7DD68AB45E7964 /* Frameworks */, AEE348721F7DD68AB45E7964 /* Frameworks */,
@ -500,6 +541,7 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
1B056DF42DDABE2B007EE38D /* Veloria.app */, 1B056DF42DDABE2B007EE38D /* Veloria.app */,
BFCCE12D2DFFFAB600EDE165 /* NotificationService.appex */,
); );
name = Products; name = Products;
sourceTree = "<group>"; sourceTree = "<group>";
@ -879,6 +921,7 @@
BF0FA78A2DE164C100C9E5F2 /* VPSearchResultCell.swift */, BF0FA78A2DE164C100C9E5F2 /* VPSearchResultCell.swift */,
BF0FA7902DE16CBF00C9E5F2 /* VPSearchHistoryView.swift */, BF0FA7902DE16CBF00C9E5F2 /* VPSearchHistoryView.swift */,
BF5E75BF2DE5566200DE9DFE /* VPHomePageControlView.swift */, BF5E75BF2DE5566200DE9DFE /* VPHomePageControlView.swift */,
BFCCE1412E000F4800EDE165 /* VPHomePlayHistoricalView.swift */,
); );
path = View; path = View;
sourceTree = "<group>"; sourceTree = "<group>";
@ -1143,6 +1186,15 @@
path = Guide; path = Guide;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
BFCCE13C2DFFFAC500EDE165 /* NotificationService */ = {
isa = PBXGroup;
children = (
BFCCE13A2DFFFAC500EDE165 /* Info.plist */,
BFCCE13B2DFFFAC500EDE165 /* NotificationService.swift */,
);
path = NotificationService;
sourceTree = "<group>";
};
BFF5AFBB2DE837710044227A /* Wallet */ = { BFF5AFBB2DE837710044227A /* Wallet */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
@ -1245,6 +1297,7 @@
BFF5B23A2DF018900044227A /* VPAlertView.swift */, BFF5B23A2DF018900044227A /* VPAlertView.swift */,
BFF5B2382DF014520044227A /* VPBaseAlertView.swift */, BFF5B2382DF014520044227A /* VPBaseAlertView.swift */,
BFF5B2362DF013410044227A /* VPAlertWindowManager.swift */, BFF5B2362DF013410044227A /* VPAlertWindowManager.swift */,
BFCCE13F2E000ACE00EDE165 /* VPAnpsAlertView.swift */,
); );
path = Alert; path = Alert;
sourceTree = "<group>"; sourceTree = "<group>";
@ -1280,16 +1333,37 @@
1B056DF12DDABE2B007EE38D /* Frameworks */, 1B056DF12DDABE2B007EE38D /* Frameworks */,
1B056DF22DDABE2B007EE38D /* Resources */, 1B056DF22DDABE2B007EE38D /* Resources */,
D1E2E0FAE9833666668F2F70 /* [CP] Embed Pods Frameworks */, D1E2E0FAE9833666668F2F70 /* [CP] Embed Pods Frameworks */,
BFCCE1352DFFFAB600EDE165 /* Embed Foundation Extensions */,
); );
buildRules = ( buildRules = (
); );
dependencies = ( dependencies = (
BFCCE1332DFFFAB600EDE165 /* PBXTargetDependency */,
); );
name = Veloria; name = Veloria;
productName = VideoPlayer; productName = VideoPlayer;
productReference = 1B056DF42DDABE2B007EE38D /* Veloria.app */; productReference = 1B056DF42DDABE2B007EE38D /* Veloria.app */;
productType = "com.apple.product-type.application"; productType = "com.apple.product-type.application";
}; };
BFCCE12C2DFFFAB600EDE165 /* NotificationService */ = {
isa = PBXNativeTarget;
buildConfigurationList = BFCCE1392DFFFAB600EDE165 /* Build configuration list for PBXNativeTarget "NotificationService" */;
buildPhases = (
BFCCE1292DFFFAB600EDE165 /* Sources */,
BFCCE12A2DFFFAB600EDE165 /* Frameworks */,
BFCCE12B2DFFFAB600EDE165 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = NotificationService;
packageProductDependencies = (
);
productName = NotificationService;
productReference = BFCCE12D2DFFFAB600EDE165 /* NotificationService.appex */;
productType = "com.apple.product-type.app-extension";
};
/* End PBXNativeTarget section */ /* End PBXNativeTarget section */
/* Begin PBXProject section */ /* Begin PBXProject section */
@ -1305,6 +1379,9 @@
CreatedOnToolsVersion = 16.2; CreatedOnToolsVersion = 16.2;
LastSwiftMigration = 1620; LastSwiftMigration = 1620;
}; };
BFCCE12C2DFFFAB600EDE165 = {
CreatedOnToolsVersion = 16.2;
};
}; };
}; };
buildConfigurationList = 1B056DEF2DDABE2B007EE38D /* Build configuration list for PBXProject "Veloria" */; buildConfigurationList = 1B056DEF2DDABE2B007EE38D /* Build configuration list for PBXProject "Veloria" */;
@ -1326,6 +1403,7 @@
projectRoot = ""; projectRoot = "";
targets = ( targets = (
1B056DF32DDABE2B007EE38D /* Veloria */, 1B056DF32DDABE2B007EE38D /* Veloria */,
BFCCE12C2DFFFAB600EDE165 /* NotificationService */,
); );
}; };
/* End PBXProject section */ /* End PBXProject section */
@ -1344,6 +1422,13 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
BFCCE12B2DFFFAB600EDE165 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */ /* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */
@ -1468,6 +1553,7 @@
BF5E75CC2DE5692D00DE9DFE /* JXTransitionDefine.swift in Sources */, BF5E75CC2DE5692D00DE9DFE /* JXTransitionDefine.swift in Sources */,
BF5E75CD2DE5692D00DE9DFE /* JXTransitionDelegateBridge.swift in Sources */, BF5E75CD2DE5692D00DE9DFE /* JXTransitionDelegateBridge.swift in Sources */,
BF5E75CE2DE5692D00DE9DFE /* JXPushAnimatedTransition.swift in Sources */, BF5E75CE2DE5692D00DE9DFE /* JXPushAnimatedTransition.swift in Sources */,
BFCCE1402E000ACE00EDE165 /* VPAnpsAlertView.swift in Sources */,
BF5E75CF2DE5692D00DE9DFE /* UIViewController+JXTransition.swift in Sources */, BF5E75CF2DE5692D00DE9DFE /* UIViewController+JXTransition.swift in Sources */,
BFF5B26E2DF297680044227A /* VPOpenAppModel.swift in Sources */, BFF5B26E2DF297680044227A /* VPOpenAppModel.swift in Sources */,
BFF5B23F2DF0443B0044227A /* VPWebScriptModel.swift in Sources */, BFF5B23F2DF0443B0044227A /* VPWebScriptModel.swift in Sources */,
@ -1586,6 +1672,7 @@
BFCCE1122DF9638B00EDE165 /* VPVipAlertView.swift in Sources */, BFCCE1122DF9638B00EDE165 /* VPVipAlertView.swift in Sources */,
BF0FA7172DDC78FF00C9E5F2 /* ZKCycleScrollView.swift in Sources */, BF0FA7172DDC78FF00C9E5F2 /* ZKCycleScrollView.swift in Sources */,
BFF5B4AF2DF6B6630044227A /* VPMutualCollectionView.swift in Sources */, BFF5B4AF2DF6B6630044227A /* VPMutualCollectionView.swift in Sources */,
BFCCE1422E000F4800EDE165 /* VPHomePlayHistoricalView.swift in Sources */,
BF0FA7612DDFFE7100C9E5F2 /* VPVideoDetailModel.swift in Sources */, BF0FA7612DDFFE7100C9E5F2 /* VPVideoDetailModel.swift in Sources */,
BFF5AFD22DE9A58A0044227A /* VPVIPRecordViewController.swift in Sources */, BFF5AFD22DE9A58A0044227A /* VPVIPRecordViewController.swift in Sources */,
BFF5AFDA2DEE90350044227A /* VPVideoLockView.swift in Sources */, BFF5AFDA2DEE90350044227A /* VPVideoLockView.swift in Sources */,
@ -1611,8 +1698,24 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
BFCCE1292DFFFAB600EDE165 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
BFCCE13D2DFFFAC500EDE165 /* NotificationService.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */ /* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
BFCCE1332DFFFAB600EDE165 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = BFCCE12C2DFFFAB600EDE165 /* NotificationService */;
targetProxy = BFCCE1322DFFFAB600EDE165 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */ /* Begin PBXVariantGroup section */
1B056E252DDAC0FD007EE38D /* LaunchScreen.storyboard */ = { 1B056E252DDAC0FD007EE38D /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup; isa = PBXVariantGroup;
@ -1833,6 +1936,62 @@
}; };
name = Release; name = Release;
}; };
BFCCE1362DFFFAB600EDE165 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 394VH538M8;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = NotificationService/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = NotificationService;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.qjwl168.veloria.ios.NotificationService;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
BFCCE1372DFFFAB600EDE165 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 394VH538M8;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = NotificationService/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = NotificationService;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.qjwl168.veloria.ios.NotificationService;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
/* End XCBuildConfiguration section */ /* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */ /* Begin XCConfigurationList section */
@ -1854,6 +2013,15 @@
defaultConfigurationIsVisible = 0; defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release; defaultConfigurationName = Release;
}; };
BFCCE1392DFFFAB600EDE165 /* Build configuration list for PBXNativeTarget "NotificationService" */ = {
isa = XCConfigurationList;
buildConfigurations = (
BFCCE1362DFFFAB600EDE165 /* Debug */,
BFCCE1372DFFFAB600EDE165 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */ /* End XCConfigurationList section */
/* Begin XCRemoteSwiftPackageReference section */ /* Begin XCRemoteSwiftPackageReference section */

View File

@ -51,7 +51,7 @@ extension AppDelegate {
} }
private func showApnsAlert() { private func showApnsAlert() {
let alert = VPAlertView(title: "open_notice_at_watch_video".localized, subtitle: "veloria_open_notice_alert_text".localized, icon: UIImage(named: "alert_icon_03"), normalButtonText: nil, highlightButtonText: "veloria_allow".localized) let alert = VPAnpsAlertView(title: "veloria_open_notice_at_watch_video".localized, subtitle: "veloria_open_notice_alert_text".localized, icon: UIImage(named: "alert_icon_03"), normalButtonText: nil, highlightButtonText: "veloria_allow".localized)
alert.show() alert.show()
alert.clickHighlightButton = { [weak self] in alert.clickHighlightButton = { [weak self] in

View File

@ -83,14 +83,12 @@ extension VPApi: TargetType {
"lang-key" : VPLocalizedManager.shared.currentLocalizedKey,// "lang-key" : VPLocalizedManager.shared.currentLocalizedKey,//
"time-zone" : String.timeZone(), // "time-zone" : String.timeZone(), //
"app-version" : kVPAPPVersion, "app-version" : kVPAPPVersion,
// "device-id" : JXUUID.systemUUID(), //id
"device-id" : JXUUID.uuid(), //id "device-id" : JXUUID.uuid(), //id
"brand" : "apple", // "brand" : "apple", //
"app-name" : kVPAPPBundleIdentifier, "app-name" : kVPAPPBundleIdentifier,
"system-type" : "ios", "system-type" : "ios",
"idfa" : JXUUID.idfa(), "idfa" : JXUUID.idfa(),
"model" : UIDevice.vp_machineModelName(), "model" : UIDevice.vp_machineModelName(),
// "security" : "false",
] ]
// //
dic["authorization"] = userToken dic["authorization"] = userToken

View File

@ -138,6 +138,11 @@ class VPHomePageViewController: VPViewController {
return view return view
}() }()
private lazy var playHistoricalView: VPHomePlayHistoricalView = {
let view = VPHomePlayHistoricalView()
return view
}()
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
@ -237,6 +242,7 @@ extension VPHomePageViewController {
view.addSubview(searchButton) view.addSubview(searchButton)
view.addSubview(historyButton) view.addSubview(historyButton)
view.addSubview(pageView) view.addSubview(pageView)
view.addSubview(playHistoricalView)
titleLabel.snp.makeConstraints { make in titleLabel.snp.makeConstraints { make in
make.centerX.equalToSuperview() make.centerX.equalToSuperview()
@ -257,6 +263,12 @@ extension VPHomePageViewController {
make.width.height.equalTo(40) make.width.height.equalTo(40)
make.centerY.equalTo(searchButton) make.centerY.equalTo(searchButton)
} }
playHistoricalView.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.right.equalToSuperview().offset(15)
make.bottom.equalToSuperview().offset(-(UIScreen.customTabBarHeight + 10))
}
} }
} }

View File

@ -0,0 +1,46 @@
//
// VPHomePlayHistoricalView.swift
// Veloria
//
// Created by on 2025/6/16.
//
import UIKit
class VPHomePlayHistoricalView: UIView {
private lazy var bgView: UIView = {
let view = UIView()
view.layer.cornerRadius = 10
view.layer.masksToBounds = true
view.addEffectView(style: .dark)
return view
}()
override init(frame: CGRect) {
super.init(frame: frame)
vp_setupUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
extension VPHomePlayHistoricalView {
private func vp_setupUI() {
addSubview(bgView)
bgView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.top.equalToSuperview().offset(12)
make.height.equalTo(56)
}
}
}

View File

@ -14,7 +14,7 @@ class VPAlertView: VPBaseAlertView {
var clickCloseButton: (() -> Void)? var clickCloseButton: (() -> Void)?
private lazy var bgView: UIImageView = { private(set) lazy var bgView: UIImageView = {
let imageView = UIImageView(image: UIImage(named: "alert_bg_image_01")) let imageView = UIImageView(image: UIImage(named: "alert_bg_image_01"))
imageView.backgroundColor = .colorFFFFFF() imageView.backgroundColor = .colorFFFFFF()
imageView.layer.cornerRadius = 18 imageView.layer.cornerRadius = 18
@ -169,7 +169,7 @@ extension VPAlertView {
titleLabel.snp.makeConstraints { make in titleLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(33) make.left.equalToSuperview().offset(33)
make.top.equalToSuperview().offset(36) make.top.equalToSuperview().offset(36)
make.right.lessThanOrEqualToSuperview().offset(-100) make.right.lessThanOrEqualToSuperview().offset(-130)
} }
titleIconImageView.snp.makeConstraints { make in titleIconImageView.snp.makeConstraints { make in

View File

@ -0,0 +1,35 @@
//
// VPAnpsAlertView.swift
// Veloria
//
// Created by on 2025/6/16.
//
import UIKit
class VPAnpsAlertView: VPAlertView {
private lazy var switchIconImageView: UIImageView = {
let imageView = UIImageView(image: UIImage(named: "switch_icon_01"))
return imageView
}()
override init(title: String, subtitle: String, icon: UIImage?, normalButtonText: String?, highlightButtonText: String?) {
super.init(title: title, subtitle: subtitle, icon: icon, normalButtonText: normalButtonText, highlightButtonText: highlightButtonText)
bgView.addSubview(switchIconImageView)
switchIconImageView.snp.makeConstraints { make in
make.right.equalToSuperview().offset(-13)
make.top.equalToSuperview().offset(63)
}
}
@MainActor required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}

View File

@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Frame@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Frame@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -144,7 +144,7 @@
"veloria_action_cannot_undone" = "This action cannot be undone."; "veloria_action_cannot_undone" = "This action cannot be undone.";
"veloria_un_favorites" = "UnFavorites"; "veloria_un_favorites" = "UnFavorites";
"veloria_un_favorites_text" = "You may not find this collection after you uncollect it"; "veloria_un_favorites_text" = "You may not find this collection after you uncollect it";
"open_notice_at_watch_video" = "Turn on Notifications?"; "veloria_open_notice_at_watch_video" = "Turn on Notifications?";
"veloria_open_notice_alert_text" = "Get alerts for new episodes and exclusive offers."; "veloria_open_notice_alert_text" = "Get alerts for new episodes and exclusive offers.";
"veloria_vip_splash_title" = "Unlock VIP Privileges!"; "veloria_vip_splash_title" = "Unlock VIP Privileges!";
"veloria_vip_splash_content" = "Enjoy ad-free streaming, early access, and exclusive content!"; "veloria_vip_splash_content" = "Enjoy ad-free streaming, early access, and exclusive content!";