first commit
This commit is contained in:
73
src/api/firebase_dynamic_link.js
Normal file
73
src/api/firebase_dynamic_link.js
Normal file
@@ -0,0 +1,73 @@
|
||||
import axios from "axios";
|
||||
|
||||
const url = "https://firebasedynamiclinks.googleapis.com/v1/shortLinks?key=AIzaSyAOY4pgYs2swcllYCWjJF3bZUkNC6LWPqI"
|
||||
|
||||
async function shareCreatorChannel(channelInfo, utmSource, utmMedium, utmCampaign) {
|
||||
const data = {
|
||||
"dynamicLinkInfo": {
|
||||
"domainUriPrefix": "https://yozm.page.link",
|
||||
"link": "https://yozm.day/?channel_id=" + channelInfo.id,
|
||||
"androidInfo": {
|
||||
"androidPackageName": "kr.co.vividnext.sodalive",
|
||||
},
|
||||
"iosInfo": {
|
||||
"iosBundleId": "kr.co.vividnext.yozm",
|
||||
"iosAppStoreId": "1630284226"
|
||||
},
|
||||
"analyticsInfo": {
|
||||
"googlePlayAnalytics": {
|
||||
"utmSource": utmSource,
|
||||
"utmMedium": utmMedium,
|
||||
"utmCampaign": utmCampaign,
|
||||
},
|
||||
},
|
||||
"socialMetaTagInfo": {
|
||||
"socialTitle": "요즘라이브",
|
||||
"socialDescription": "요즘라이브 " + channelInfo.nickname + "님의 채널입니다.",
|
||||
"socialImageLink": channelInfo.profileUrl
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return axios.post(url, data, {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
async function shareAudioContent(audioContent, utmSource, utmMedium, utmCampaign) {
|
||||
const data = {
|
||||
"dynamicLinkInfo": {
|
||||
"domainUriPrefix": "https://yozm.page.link",
|
||||
"link": "https://yozm.day/?audio_content_id=" + audioContent.audioContentId,
|
||||
"androidInfo": {
|
||||
"androidPackageName": "kr.co.vividnext.yozm",
|
||||
},
|
||||
"iosInfo": {
|
||||
"iosBundleId": "kr.co.vividnext.yozm",
|
||||
"iosAppStoreId": "1630284226"
|
||||
},
|
||||
"analyticsInfo": {
|
||||
"googlePlayAnalytics": {
|
||||
"utmSource": utmSource,
|
||||
"utmMedium": utmMedium,
|
||||
"utmCampaign": utmCampaign,
|
||||
},
|
||||
},
|
||||
"socialMetaTagInfo": {
|
||||
"socialTitle": audioContent.title + " - " + audioContent.creatorNickname,
|
||||
"socialDescription": "지금 요즘라이브에서 이 콘텐츠 감상하기",
|
||||
"socialImageLink": audioContent.coverImageUrl
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return axios.post(url, data, {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export { shareCreatorChannel, shareAudioContent }
|
||||
Reference in New Issue
Block a user