Uygulamanıza ekleyeceğiniz basit kodlarla indirmeleri güvenle takip edin
Tüm indirme kampanyalarınız için aşağıdaki link formatını kullanın:
Kampanya ID'nizi Fenomoney panelinizden alabilirsiniz.
Uygulamanızın platformuna göre entegrasyon kodu
Kotlin ile entegrasyon
Kodu Göster// Kotlin implementation
fun verifyFenomoneyDownload(context: Context, campaignId: String) {
val url = "https://app.fenomoney.com/api/"
val deviceId = Settings.Secure.getString(
context.contentResolver,
Settings.Secure.ANDROID_ID
)
// Implementation continues...
}
Swift ile entegrasyon
Kodu Göster// Swift implementation
func verifyFenomoneyDownload(campaignId: String) {
guard let url = URL(string: "https://app.fenomoney.com/api/") else { return }
let deviceId = UIDevice.current.identifierForVendor?.uuidString ?? ""
// Implementation continues...
}
JavaScript ile entegrasyon
Kodu Göster// JavaScript implementation
async function verifyFenomoneyDownload(campaignId) {
const url = 'https://app.fenomoney.com/api/';
const deviceId = localStorage.getItem('fenomoney_device_id') ||
generateDeviceId();
// Implementation continues...
}
Dart ile entegrasyon
Kodu Göster// Flutter implementation FutureverifyFenomoneyDownload(String campaignId) async { final url = 'https://app.fenomoney.com/api/'; final deviceInfo = DeviceInfoPlugin(); // Implementation continues... }
import android.content.Context
import android.content.SharedPreferences
import android.provider.Settings
import okhttp3.*
import java.io.IOException
import java.util.*
fun getFenomoneyDeviceId(context: Context): String {
val prefs: SharedPreferences = context.getSharedPreferences("fenomoney_prefs", Context.MODE_PRIVATE)
var deviceId = prefs.getString("fenomoney_device_id", null)
if (deviceId == null) {
val androidId = Settings.Secure.getString(context.contentResolver, Settings.Secure.ANDROID_ID)
deviceId = UUID.nameUUIDFromBytes(androidId.toByteArray()).toString()
prefs.edit().putString("fenomoney_device_id", deviceId).apply()
}
return deviceId
}
fun verifyFenomoneyDownload(context: Context, campaignId: String) {
val url = "https://app.fenomoney.com/api/"
val deviceId = getFenomoneyDeviceId(context)
val formBody = FormBody.Builder()
.add("campaign_id", campaignId)
.add("device_info", deviceId)
.build()
val request = Request.Builder()
.url(url)
.post(formBody)
.build()
val client = OkHttpClient()
client.newCall(request).enqueue(object : Callback {
override fun onFailure(call: Call, e: IOException) {
Log.e("Fenomoney", "Doğrulama hatası: ${e.message}")
}
override fun onResponse(call: Call, response: Response) {
val body = response.body?.string()
Log.d("Fenomoney", "Doğrulama sonucu: $body")
}
})
}
import UIKit
func getFenomoneyDeviceId() -> String {
let key = "fenomoney_device_id"
if let id = UserDefaults.standard.string(forKey: key) {
return id
} else {
let newId = UIDevice.current.identifierForVendor?.uuidString ?? UUID().uuidString
UserDefaults.standard.set(newId, forKey: key)
return newId
}
}
func verifyFenomoneyDownload(campaignId: String) {
guard let url = URL(string: "https://app.fenomoney.com/api/") else { return }
let deviceId = getFenomoneyDeviceId()
let params = "campaign_id=\(campaignId)&device_info=\(deviceId)"
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.httpBody = params.data(using: .utf8)
request.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
let task = URLSession.shared.dataTask(with: request) { data, response, error in
if let error = error {
print("Fenomoney doğrulama hatası: \(error.localizedDescription)")
return
}
guard let data = data else {
print("Fenomoney: Cevap boş")
return
}
let responseStr = String(data: data, encoding: .utf8) ?? "Boş"
print("Fenomoney doğrulama sonucu: \(responseStr)")
}
task.resume()
}
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
const getFenomoneyDeviceId = () => {
const key = 'fenomoney_device_id';
let deviceId = localStorage.getItem(key);
if (!deviceId) {
// Generate a unique ID if not exists
deviceId = 'web-' + Math.random().toString(36).substr(2, 9) +
'-' + Date.now().toString(36);
localStorage.setItem(key, deviceId);
}
return deviceId;
};
const verifyFenomoneyDownload = async (campaignId) => {
const url = 'https://app.fenomoney.com/api/';
const deviceId = getFenomoneyDeviceId();
try {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
body: new URLSearchParams({
campaign_id: campaignId,
device_info: deviceId
})
});
const data = await response.json();
console.log('Fenomoney doğrulama sonucu:', data);
return data;
} catch (error) {
console.error('Fenomoney doğrulama hatası:', error);
throw error;
}
};
import 'package:flutter/material.dart'; import 'package:http/http.dart' as http; import 'package:shared_preferences/shared_preferences.dart'; import 'package:device_info_plus/device_info_plus.dart'; import 'dart:convert'; FuturegetFenomoneyDeviceId() async { final prefs = await SharedPreferences.getInstance(); String? deviceId = prefs.getString('fenomoney_device_id'); if (deviceId == null) { final deviceInfo = DeviceInfoPlugin(); String rawId; if (Theme.of(navigatorKey.currentContext!).platform == TargetPlatform.android) { final androidInfo = await deviceInfo.androidInfo; rawId = androidInfo.androidId ?? ''; } else if (Theme.of(navigatorKey.currentContext!).platform == TargetPlatform.iOS) { final iosInfo = await deviceInfo.iosInfo; rawId = iosInfo.identifierForVendor ?? ''; } else { rawId = DateTime.now().millisecondsSinceEpoch.toString(); } deviceId = rawId.hashCode.toString(); await prefs.setString('fenomoney_device_id', deviceId); } return deviceId; } Future verifyFenomoneyDownload(String campaignId) async { final url = Uri.parse('https://app.fenomoney.com/api/'); final deviceId = await getFenomoneyDeviceId(); final response = await http.post(url, body: { 'campaign_id': campaignId, 'device_info': deviceId, }); if (response.statusCode == 200) { print('Doğrulama sonucu: ${response.body}'); } else { print('Doğrulama hatası: ${response.statusCode}'); } }
dependencies: http: ^0.13.0 shared_preferences: ^2.0.15 device_info_plus: ^9.0.2
https://app.fenomoney.com/api adresini kullanarak test yapabilirsiniz. Test kampanya ID'leri için dev@fenomoney.com ile iletişime geçin.
Fenomoney loglarınıza kaydedip support@fenomoney.com'a bildirin.
Entegrasyon sürecinde sorun yaşarsanız Fenomoney destek ekibimiz hazır!