Skip to content

Commit

Permalink
v1.3.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
nerycat32 committed Dec 14, 2022
1 parent e4a3515 commit 796fcec
Show file tree
Hide file tree
Showing 117 changed files with 1,739 additions and 395 deletions.
32 changes: 31 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
v.1.3.1
-------------

버그수정 :
카메라를 통해 사진을 첨부하는 경우 글쓰기 실패하는 사항 수정


v.1.3.0
-------------
개선사항 :
네이버 로그아웃 인터페이스 추가


v.1.2.0
-------------
개선사항 :
글 쓰기 화면 인터페이스 추가
캡처 후 글 쓰기 기능 추가
게시판 선택 기능 추가
게임 아이디 연동 인터페이스 추가
네이버 3rd Party 로그인 지원
게시판 접근 권한 적용


v.1.1.7
-------------
버그수정 :
네이버 로그인 화면에서 외부로 URL 이 연결되는 현상 수정


v.1.1.3
-------------
버그수정 :
Expand Down Expand Up @@ -40,4 +70,4 @@ v.1.1.0

v.1.0.0
-------------
Naver Game SDK 오픈
Naver Game SDK 오픈
49 changes: 42 additions & 7 deletions Plugins/android/com/navercorp/nng/cocos2dx/sample/NNGSdk.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.navercorp.nng.cocos2dx.sample;

import android.widget.Toast;

import com.navercorp.nng.android.sdk.NNGCallbackListener;
import com.navercorp.nng.android.sdk.NNGLink;

Expand All @@ -21,27 +23,39 @@ public static void init(String clientId, String clientSecret, String loungeId) {
}

private static void initListeners() {

NNGLink.setSdkLoadListener(new NNGCallbackListener() {
@Override
public void onSdkDidLoaded() {
onSdkStarted();

}

@Override
public void onSdkDidUnloaded() {
onSdkStopped();

}

@Override
public void onCallInGameMenuCode(String inGameMenuCode) {
Toast.makeText(getActivity(),"onCallInGameMenuCode [" + inGameMenuCode + "]",Toast.LENGTH_LONG).show();
}

@Override
public void onNaverLoggedIn(boolean success) { }
public void onNaverLoggedIn() {

}

@Override
public void onCallInGameMenuCode(String moveTo) {
onSdkReceiveInGameMenuCode(moveTo);
public void onNaverLoggedOut() {

}
});
}

public static String getCountryCode() {
return NNGLink.getCountryCode(getActivity());
}

public static void startHomeBanner() {
NNGLink.startHome(getActivity());
}
Expand All @@ -54,8 +68,29 @@ public static void startBoard(int boardId) {
NNGLink.startBoard(getActivity(), boardId);
}

public static void startFeed(int feedId) {
NNGLink.startFeed(getActivity(), feedId);
public static void startFeed(int feedId, boolean isTempFeedId) {
NNGLink.startFeed(getActivity(), feedId, isTempFeedId);
}
public static void putGameId(String gameId) {
NNGLink.putGameId(getActivity(), gameId);
}

public static void enableScreenShotDetector(Boolean enable) {
NNGLink.enableScreenShotDetector(enable);
}

public static void logout() {
NNGLink.logout(getActivity());
}

public static void writeFeed(int boardId,
String title,
String content,
String imageUri) {
NNGLink.writeFeed(getActivity(), boardId,title,content,imageUri);
}
public static void writeFeed() {
NNGLink.writeFeed(getActivity());
}

public static void stopSdk() {
Expand Down
Binary file removed Plugins/android/navergame-sdk-gradle-1.1.3.aar
Binary file not shown.
Binary file added Plugins/android/navergame-sdk-gradle-1.3.1.aar
Binary file not shown.
27 changes: 21 additions & 6 deletions Plugins/navergamesdk/NaverGameSDK.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
#ifndef _JNI_NAVER_GAME_SDK_H_
#define _JNI_NAVER_GAME_SDK_H_

#include <string>

namespace nng {

class NaverGameSDKListener {
public:
// Sdk 시작시에 이벤트.
virtual void onSdkStarted() = 0;

// Sdk 종료시에 이벤트.
virtual void onSdkStopped() = 0;

// Sdk 실행 중에 유저가 특정 액션을 하게되면 귀사에서 설정한 string을 파라미터로 받는 이벤트.
virtual void onSdkReceiveInGameMenuCode(const std::string &inGameMenuCode) = 0;
};

Expand All @@ -17,19 +20,31 @@ namespace nng {
/* 네아로 정보와 라운지 아이디로 sdk 초기화 합니다. */
static void init(std::string clientId, std::string clientSecret, std::string loungeId);

// Sdk에서 보내오는 각종 이벤트를 받는 리스너를 등록합니다.
static void setSdkListener(NaverGameSDKListener* listener);

// Sdk를 실행하는 기기의 국가코드를 가져옵니다.
static char* getCountryCode();

// Sdk의 홈배너를 실행합니다.
static void startHomeBanner();

// Sdk의 점검배너를 실행합니다.
static void startSorryBanner();

// Sdk의 라운지 boardId와 매핑되는 글목록을 실행합니다.
static void startBoard(int boardId);

static void startFeed(int feedId);

static void stopSdk();
// Sdk의 라운지 FeedId와 매핑되는 글상세를 실행합니다.
static void startFeed(int feedId, bool isTempFeedId);

static void setCanWriteFeedByScreenshot(bool Enabled);
static void setGameId(std::string GameId);
static void startFeedWriting(int BoardId, std::string Title, std::string Text, std::string ImageFilePath);
static void naverLogout();

// Sdk를 종료시킵니다.
static void stopSdk();
};
} /* namespace nng */

#endif /* _JNI_NAVER_GAME_SDK_H_ */
63 changes: 57 additions & 6 deletions Plugins/navergamesdk/platform/android/NaverGameSDK.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@



#include "NaverGameSDK.h"
#include "platform/android/jni/JniHelper.h"

Expand Down Expand Up @@ -34,6 +31,20 @@ namespace nng {
}
}

char* NaverGameSDK::getCountryCode() {
JniMethodInfo t;
jstring countryCodeJstr = nullptr;
if (getStaticMethod(t, "getCountryCode", "()Ljava/lang/String;")) {
countryCodeJstr = (jstring)t.env->CallStaticObjectMethod(t.classID, t.methodID);
t.env->DeleteLocalRef(t.classID);
}

auto countryCode = countryCodeJstr == nullptr? "" : JniHelper::jstring2string(countryCodeJstr);
CCLOG("countryCode = %s", (char*)countryCode.c_str());

return (char*)countryCode.c_str();
}

void NaverGameSDK::startHomeBanner() {
JniMethodInfo t;
if (getStaticMethod(t, "startHomeBanner", "()V")) {
Expand All @@ -58,10 +69,49 @@ namespace nng {
}
}

void NaverGameSDK::startFeed(int feedId) {
void NaverGameSDK::startFeed(int feedId, bool isTempFeedId) {
JniMethodInfo t;
if (getStaticMethod(t, "startFeed", "(IZ)V")) {
t.env->CallStaticVoidMethod(t.classID, t.methodID, feedId,isTempFeedId);
t.env->DeleteLocalRef(t.classID);
}
}
void NaverGameSDK::setCanWriteFeedByScreenshot(bool isTempFeedId) {
JniMethodInfo t;
if (getStaticMethod(t, "startFeed", "(I)V")) {
t.env->CallStaticVoidMethod(t.classID, t.methodID, feedId);
if (getStaticMethod(t, "enableScreenShotDetector", "(Z)V")) {
t.env->CallStaticVoidMethod(t.classID, t.methodID, isTempFeedId);
t.env->DeleteLocalRef(t.classID);
}
}
void NaverGameSDK::setGameId(std::string gameId) {
JniMethodInfo t;
if (getStaticMethod(t, "putGameId","(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V")) {
jstring _gameId = t.env->NewStringUTF(gameId.c_str());
t.env->CallStaticVoidMethod(t.classID, t.methodID, _gameId);
t.env->DeleteLocalRef(_gameId);
t.env->DeleteLocalRef(t.classID);
}
}

void NaverGameSDK::startFeedWriting(int boardId, std::string title, std::string text, std::string imageFilePath) {
JniMethodInfo t;
if (getStaticMethod(t, "writeFeed","(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V")) {
jstring _title = t.env->NewStringUTF(title.c_str());
jstring _text = t.env->NewStringUTF(text.c_str());
jstring _imageFilePath = t.env->NewStringUTF(imageFilePath.c_str());

t.env->CallStaticVoidMethod(t.classID, t.methodID, boardId,_title, _text, _imageFilePath);

t.env->DeleteLocalRef(_title);
t.env->DeleteLocalRef(_text);
t.env->DeleteLocalRef(_imageFilePath);
t.env->DeleteLocalRef(t.classID);
}
}
void NaverGameSDK::naverLogout() {
JniMethodInfo t;
if (getStaticMethod(t, "logout", "()V")) {
t.env->CallStaticVoidMethod(t.classID, t.methodID);
t.env->DeleteLocalRef(t.classID);
}
}
Expand All @@ -74,6 +124,7 @@ namespace nng {
}
}


extern "C" {
JNIEXPORT void JNICALL
Java_com_navercorp_nng_cocos2dx_sample_NNGSdk_onSdkStarted(JNIEnv* env, jclass thiz) {
Expand Down
Binary file modified Plugins/navergamesdk/platform/ios/NNGSDK.bundle/Info.plist
Binary file not shown.

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 796fcec

Please sign in to comment.