Android SDK 빠른 시작
Pushwoosh Android SDK 를 사용하여 빠르고 간단하게 시작합니다.
필수 구성 요소
Anchor link to앱에 Pushwoosh Android SDK 를 통합하려면 다음이 필요합니다:
예제 프로젝트 다운로드
Anchor link toGitHub 에서 예제 프로젝트를 복제합니다:
git clone https://github.com/Pushwoosh/pushwoosh-android-sample프로젝트 구성
Anchor link to-
google-services.json 파일을 pushwoosh-demoapp/app 디렉터리에 배치합니다.
-
build.gradle (Module: app) 에서
applicationId를 패키지 이름과 일치하도록 업데이트합니다. -
res/values/strings.xml 에서 플레이스홀더 값을 특정 세부 정보로 바꿉니다:
pushwoosh_app_id: Pushwoosh App Code 를 사용합니다.fcm_sender_id: Firebase Project Number 를 사용합니다.pushwoosh_api_token: Pushwoosh Device API Token 을(를) 사용합니다.
<resources> <string name="app_name">demoapp</string> <string name="title_home">Actions</string> <string name="title_notifications">Settings</string> <string name="pushwoosh_app_id">_YOUR_PUSHWOOSH_APP_ID_</string> <string name="fcm_sender_id">_YOUR_FIREBASE_PROJECT_ID_</string> <string name="pushwoosh_api_token">_YOUR_PUSHWOOSH_DEVICE_API_TOKEN_</string></resources>프로젝트 실행
Anchor link to- 프로젝트를 빌드하고 실행합니다.
- 앱에는 “Actions” 및 “Settings” 두 개의 탭이 있습니다. Settings 탭으로 이동합니다.
- Register for Pushes 버튼을 탭합니다.
- Push notifications 에 대한 권한을 부여합니다. 장치가 Pushwoosh 에 등록됩니다.
다음과 같은 로그 항목이 표시됩니다:
Log level: INFO[RequestPermissionHelper] Requesting permissionsPushwoosh SDK initialized successfullyHWID: __HWID_OF_YOUR_DEVICE__APP_CODE: __YOUR_PUSHWOOSH_APP_ID__PUSHWOOSH_SDK_VERSION: __PUSHWOOSH_SDK_VERSION_INSTALLED__FIREBASE_PROJECT_ID: __YOUR_FIREBASE_PROJECT_ID__PUSH_TOKEN:User ID "__USER_ID_OF_THE_DEVICE__" successfully set
[NotificationManager] Registered for push notifications: __DEVICE_PUSH_TOKEN__Push notification 전송
Anchor link toPushwoosh Control Panel 로 돌아가 push notification 을 전송합니다.
다음 단계
Anchor link to자세한 내용은 기본 통합 가이드를 참조하십시오.