[Android] 앱에서 플레이스토어 링크 공유하는 기능 만들기(Create a playstore link sharing app in your app)

기타|2019. 6. 15. 16:26
반응형

 내 앱의 홍보 등을 위해 공유 기능을 넣어서 플레이스토어 링크를 보내고 싶은 경우가 있습니다.

 생각보다 간단한 기능인데 제대로 안하면 리스트가 안뜨거나 떠도 안보내지는 경우 등의 문제가 있더라고요.

구글링 해봐도 제대로 된게 잘 안나와서 남깁니다.

In some cases, you may want to share a Play Store link to promote your app. 
 It's a simpler function than you might think. 
I do not get it right when I try to google it.

 

Intent intent = new Intent(android.content.Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(android.content.Intent.EXTRA_TEXT, "플레이스토어 주소");
intent.putExtra(android.content.Intent.EXTRA_SUBJECT,"전달 메시지(다운 받아봐~), 없어도 됨");
startActivity(Intent.createChooser(intent, "Share"));

 

반응형