millo-L / react-native-kakao-share-link

리액트 네이티브 카카오 링크 오픈 소스
MIT License
30 stars 24 forks source link

button title 적용 안됨 #3

Closed HoWWWWWhy closed 2 years ago

HoWWWWWhy commented 2 years ago

sendFeed 예제 코드를 그대로 적용했는데 자세히보기에서 앱에서 보기로 바뀌지 않습니다.

millo-L commented 2 years ago

어떤 OS로 테스트 하셨는지 말씀해주실 수 있으신가요??

button을 넣으실 때 항상 link 값에 web, mobile, ios, android 중 꼭 한 값 이상을 넣으셔야 합니다!

전체 코드를 올려주시면 감사하겠습니다!

HoWWWWWhy commented 2 years ago

안드로이드로 개발 하고 있습니다. 테스트폰은 안드로이드 버전 8.0.0입니다.

      const response = await KakaoShareLink.sendFeed({
        content: {
          title: 'Heartwarming',
          imageUrl:
            'https://play-lh.googleusercontent.com/jK5vscIO0bz9gC9N-byOvAWIHvmJac91KuGC89rYGPaUcdGK__2i-_w7jpyEACmrQc6m=s360-rw',
          link: {
            webUrl: 'https://developers.kakao.com/',
            mobileWebUrl: 'https://developers.kakao.com/',
          },
          description: 'Heartwarming',
          buttons: [
            {
              title: '앱에서 보기',
              link: {
                androidExecutionParams: [
                  {key: 'from', value: 'link'},
                  {key: 'to', value: 'add'},
                  {
                    key: 'contents',
                    value: `${contents.length > 0 ? contents : '-'}`,
                  },
                  {
                    key: 'prepos',
                    value: `${prepos.length > 0 ? prepos : 'blank'}`,
                  },
                  {
                    key: 'source',
                    value: `${source.length > 0 ? source : '-'}`,
                  },
                ],
                iosExecutionParams: [
                  {key: 'from', value: 'link'},
                  {key: 'to', value: 'add'},
                  {
                    key: 'contents',
                    value: `${contents.length > 0 ? contents : '-'}`,
                  },
                  {
                    key: 'prepos',
                    value: `${prepos.length > 0 ? prepos : 'blank'}`,
                  },
                  {
                    key: 'source',
                    value: `${source.length > 0 ? source : '-'}`,
                  },
                ],
              },
            },
          ],
        },
      });

Text로 했을 때는 잘 동작하였습니다.

      const response = await KakaoShareLink.sendText({
        text: `Heartwarming`,
        link: {
          webUrl: 'https://developers.kakao.com/',
          mobileWebUrl: 'https://developers.kakao.com/',
        },
        buttons: [
          {
            title: '앱에서 보기',
            link: {
              androidExecutionParams: [
                {key: 'from', value: 'link'},
                {key: 'to', value: 'add'},
                {
                  key: 'contents',
                  value: `${contents.length > 0 ? contents : '-'}`,
                },
                {
                  key: 'prepos',
                  value: `${prepos.length > 0 ? prepos : 'blank'}`,
                },
                {
                  key: 'source',
                  value: `${source.length > 0 ? source : '-'}`,
                },
              ],
              iosExecutionParams: [
                {key: 'from', value: 'link'},
                {key: 'to', value: 'add'},
                {
                  key: 'contents',
                  value: `${contents.length > 0 ? contents : '-'}`,
                },
                {
                  key: 'prepos',
                  value: `${prepos.length > 0 ? prepos : 'blank'}`,
                },
                {
                  key: 'source',
                  value: `${source.length > 0 ? source : '-'}`,
                },
              ],
            },
          },
        ],
      });
HoWWWWWhy commented 2 years ago

코드를 올리고 보니 content의 괄호가 하나 빠진 것을 발견했습니다. 문제 해결되었습니다. 감사합니다!!!