Experience Notification Service
API 참조
메서드
Can Prompt Opt In Async
반환
코드 샘플
로컬 스크립트 - 알림 권한 프롬프트 구현
local ExperienceNotificationService = game:GetService("ExperienceNotificationService")
-- 플레이어에게 알림을 활성화하라는 메시지를 표시할 수 있는지 확인하는 함수
local function canPromptOptIn()
local success, canPrompt = pcall(function()
return ExperienceNotificationService:CanPromptOptInAsync()
end)
return success and canPrompt
end
local canPrompt = canPromptOptIn()
if canPrompt then
local success, errorMessage = pcall(function()
ExperienceNotificationService:PromptOptIn()
end)
if not success then
warn("옵트인 요청에 실패했습니다:", errorMessage)
end
end
-- 옵트인 요청 닫힘 이벤트를 수신
ExperienceNotificationService.OptInPromptClosed:Connect(function()
print("옵트인 요청이 닫혔습니다")
end)Prompt Opt In
Experience Notification Service: Prompt Opt In():()
반환
()
코드 샘플
로컬 스크립트 - 알림 권한 프롬프트 구현
local ExperienceNotificationService = game:GetService("ExperienceNotificationService")
-- 플레이어에게 알림을 활성화하라는 메시지를 표시할 수 있는지 확인하는 함수
local function canPromptOptIn()
local success, canPrompt = pcall(function()
return ExperienceNotificationService:CanPromptOptInAsync()
end)
return success and canPrompt
end
local canPrompt = canPromptOptIn()
if canPrompt then
local success, errorMessage = pcall(function()
ExperienceNotificationService:PromptOptIn()
end)
if not success then
warn("옵트인 요청에 실패했습니다:", errorMessage)
end
end
-- 옵트인 요청 닫힘 이벤트를 수신
ExperienceNotificationService.OptInPromptClosed:Connect(function()
print("옵트인 요청이 닫혔습니다")
end)이벤트
Opt In Prompt Closed
코드 샘플
로컬 스크립트 - 알림 권한 프롬프트 구현
local ExperienceNotificationService = game:GetService("ExperienceNotificationService")
-- 플레이어에게 알림을 활성화하라는 메시지를 표시할 수 있는지 확인하는 함수
local function canPromptOptIn()
local success, canPrompt = pcall(function()
return ExperienceNotificationService:CanPromptOptInAsync()
end)
return success and canPrompt
end
local canPrompt = canPromptOptIn()
if canPrompt then
local success, errorMessage = pcall(function()
ExperienceNotificationService:PromptOptIn()
end)
if not success then
warn("옵트인 요청에 실패했습니다:", errorMessage)
end
end
-- 옵트인 요청 닫힘 이벤트를 수신
ExperienceNotificationService.OptInPromptClosed:Connect(function()
print("옵트인 요청이 닫혔습니다")
end)