Giter VIP home page Giter VIP logo

ncloud-notification-sdk's Introduction

네이버 클라우드 플랫폼 Simple & Easy - Notification Service SDK

  1. 해당 프로젝트는 NCP에서 'Simple & Easy - Notification Service'라는 상품의 클라이언트 Java SDK를 제공하는 프로젝트입니다.

  2. 해당 상품에 대한 자세한 설명은 다음 주소에서 확인할 수 있습니다. 바로가기

  3. 원본 소스코드는 여기 ( ncloud_outboundmailer.zip) 에서 참고했습니다. 원래 원본에서 포크를 따오고 싶었지만, 아쉽게도 Mailer SDK는 NCP 깃허브에 올라오지 않아 Git 기록 없이 추가하게 되었습니다.

라이브러리 Import 방법

MavenCentral 레포지토리에 업로드 하기 위해선 복잡한 과정이 필요하기 때문에 아티팩트를 JitPack 레포지토리에 올렸습니다. 아울러 버전 정보는 다음 링크에서 확인할 수 있습니다. 바로가기

1.JitPack 레포지토리를 추가합니다. (settings.xml 또는 프로젝트 pom.xml에 추가할 수 있습니다)

<repositories>
	<repository>
	    <id>jitpack.io</id>
	    <url>https://jitpack.io</url>
	</repository>
</repositories>

2.라이브러리 의존성 관계를 추가합니다.

<dependency>
    <groupId>com.uanid</groupId>
    <artifactId>ncloud-notification-sdk</artifactId>
    <version>0.1</version>
</dependency>

Maven외 다른 빌드툴은 위의 링크에서 사용 방법을 확인할 수 있습니다.

사용 예시

우선 아래와 같이 사용할 Service와 SmsProfile을 정의합니다.

ApiClient apiClient = new ApiClient.ApiClientBuilder()
                      .addMarshaller(JsonMarshaller.getInstance())
                      .setCredentials(new PropertiesFileCredentialsProvider("credentials.properties").getCredentials())
                      .build();
SmsService smsService = new SmsService(apiClient); === 1 ===
OutboundMailerService mailerService = new OutboundMailerService(apiClient); === 2 ===

Properties properties = Utils.loadPropertiesFromFile("smsProfile.properties");
SmsProfile smsProfile = new SmsProfile(properties.getProperty("serviceId"), properties.getProperty("fromNumber"));

Service객체는 Thread-Safe하기 때문에 이후 싱글턴처럼 사용하면 됩니다.

기능

Cloud Outbound Mailer 상품:

  • 상품 전체 (구현)

Simple & Easy - Notification Service 상품:

  • SMS API v2 (구현)
  • PUSH API v2 (구현안됨)
  • 알림톡 API v2 (구현안됨)

사업자 등록증이 없어 알림톡과 PUSH 테스트가 불가능해 개발 할 수 없었습니다.

ncloud-notification-sdk's People

Contributors

uanid avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.