@blazium/ton-connect-mobile 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/expo.js +8 -12
- package/dist/adapters/react-native.js +8 -12
- package/package.json +1 -1
- package/src/adapters/expo.ts +10 -12
- package/src/adapters/react-native.ts +10 -12
package/dist/adapters/expo.js
CHANGED
|
@@ -44,25 +44,21 @@ class ExpoAdapter {
|
|
|
44
44
|
throw new Error('expo-linking is not available');
|
|
45
45
|
}
|
|
46
46
|
try {
|
|
47
|
-
console.log('[ExpoAdapter]
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
if (!canOpen) {
|
|
51
|
-
console.error('[ExpoAdapter] Cannot open URL - no app found that handles tonconnect:// protocol');
|
|
52
|
-
throw new Error(`Cannot open URL: ${url}. Make sure a wallet app is installed that supports tonconnect:// protocol.`);
|
|
53
|
-
}
|
|
54
|
-
console.log('[ExpoAdapter] Opening URL...');
|
|
47
|
+
console.log('[ExpoAdapter] Opening URL:', url);
|
|
48
|
+
// CRITICAL FIX: Android'de canOpenURL() tonconnect:// protokolünü tanımayabilir
|
|
49
|
+
// Bu yüzden direkt openURL() çağırıyoruz. Eğer açılamazsa hata fırlatır.
|
|
55
50
|
await Linking.openURL(url);
|
|
56
51
|
console.log('[ExpoAdapter] URL opened successfully');
|
|
57
52
|
return true;
|
|
58
53
|
}
|
|
59
54
|
catch (error) {
|
|
60
55
|
console.error('[ExpoAdapter] Error in openURL:', error);
|
|
61
|
-
//
|
|
62
|
-
|
|
63
|
-
|
|
56
|
+
// Android'de tonconnect:// protokolü tanınmıyorsa veya cüzdan yüklü değilse hata verir
|
|
57
|
+
const errorMessage = error?.message || String(error);
|
|
58
|
+
if (errorMessage.includes('No Activity found') || errorMessage.includes('No app found')) {
|
|
59
|
+
throw new Error('No TON wallet app found. Please install Tonkeeper or another TON Connect compatible wallet from Google Play Store.');
|
|
64
60
|
}
|
|
65
|
-
throw new Error(`Failed to open
|
|
61
|
+
throw new Error(`Failed to open wallet app: ${errorMessage}`);
|
|
66
62
|
}
|
|
67
63
|
}
|
|
68
64
|
async getInitialURL() {
|
|
@@ -42,25 +42,21 @@ class ReactNativeAdapter {
|
|
|
42
42
|
throw new Error('react-native Linking is not available');
|
|
43
43
|
}
|
|
44
44
|
try {
|
|
45
|
-
console.log('[ReactNativeAdapter]
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
if (!canOpen) {
|
|
49
|
-
console.error('[ReactNativeAdapter] Cannot open URL - no app found that handles tonconnect:// protocol');
|
|
50
|
-
throw new Error(`Cannot open URL: ${url}. Make sure a wallet app is installed that supports tonconnect:// protocol.`);
|
|
51
|
-
}
|
|
52
|
-
console.log('[ReactNativeAdapter] Opening URL...');
|
|
45
|
+
console.log('[ReactNativeAdapter] Opening URL:', url);
|
|
46
|
+
// CRITICAL FIX: Android'de canOpenURL() tonconnect:// protokolünü tanımayabilir
|
|
47
|
+
// Bu yüzden direkt openURL() çağırıyoruz. Eğer açılamazsa hata fırlatır.
|
|
53
48
|
await Linking.openURL(url);
|
|
54
49
|
console.log('[ReactNativeAdapter] URL opened successfully');
|
|
55
50
|
return true;
|
|
56
51
|
}
|
|
57
52
|
catch (error) {
|
|
58
53
|
console.error('[ReactNativeAdapter] Error in openURL:', error);
|
|
59
|
-
//
|
|
60
|
-
|
|
61
|
-
|
|
54
|
+
// Android'de tonconnect:// protokolü tanınmıyorsa veya cüzdan yüklü değilse hata verir
|
|
55
|
+
const errorMessage = error?.message || String(error);
|
|
56
|
+
if (errorMessage.includes('No Activity found') || errorMessage.includes('No app found')) {
|
|
57
|
+
throw new Error('No TON wallet app found. Please install Tonkeeper or another TON Connect compatible wallet from Google Play Store.');
|
|
62
58
|
}
|
|
63
|
-
throw new Error(`Failed to open
|
|
59
|
+
throw new Error(`Failed to open wallet app: ${errorMessage}`);
|
|
64
60
|
}
|
|
65
61
|
}
|
|
66
62
|
async getInitialURL() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blazium/ton-connect-mobile",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Production-ready TON Connect Mobile SDK for React Native and Expo. Implements the real TonConnect protocol for mobile applications using deep links and callbacks.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
package/src/adapters/expo.ts
CHANGED
|
@@ -53,24 +53,22 @@ export class ExpoAdapter implements PlatformAdapter {
|
|
|
53
53
|
throw new Error('expo-linking is not available');
|
|
54
54
|
}
|
|
55
55
|
try {
|
|
56
|
-
console.log('[ExpoAdapter]
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
if (!canOpen) {
|
|
60
|
-
console.error('[ExpoAdapter] Cannot open URL - no app found that handles tonconnect:// protocol');
|
|
61
|
-
throw new Error(`Cannot open URL: ${url}. Make sure a wallet app is installed that supports tonconnect:// protocol.`);
|
|
62
|
-
}
|
|
63
|
-
console.log('[ExpoAdapter] Opening URL...');
|
|
56
|
+
console.log('[ExpoAdapter] Opening URL:', url);
|
|
57
|
+
// CRITICAL FIX: Android'de canOpenURL() tonconnect:// protokolünü tanımayabilir
|
|
58
|
+
// Bu yüzden direkt openURL() çağırıyoruz. Eğer açılamazsa hata fırlatır.
|
|
64
59
|
await Linking.openURL(url);
|
|
65
60
|
console.log('[ExpoAdapter] URL opened successfully');
|
|
66
61
|
return true;
|
|
67
62
|
} catch (error: any) {
|
|
68
63
|
console.error('[ExpoAdapter] Error in openURL:', error);
|
|
69
|
-
//
|
|
70
|
-
|
|
71
|
-
|
|
64
|
+
// Android'de tonconnect:// protokolü tanınmıyorsa veya cüzdan yüklü değilse hata verir
|
|
65
|
+
const errorMessage = error?.message || String(error);
|
|
66
|
+
if (errorMessage.includes('No Activity found') || errorMessage.includes('No app found')) {
|
|
67
|
+
throw new Error(
|
|
68
|
+
'No TON wallet app found. Please install Tonkeeper or another TON Connect compatible wallet from Google Play Store.'
|
|
69
|
+
);
|
|
72
70
|
}
|
|
73
|
-
throw new Error(`Failed to open
|
|
71
|
+
throw new Error(`Failed to open wallet app: ${errorMessage}`);
|
|
74
72
|
}
|
|
75
73
|
}
|
|
76
74
|
|
|
@@ -51,24 +51,22 @@ export class ReactNativeAdapter implements PlatformAdapter {
|
|
|
51
51
|
throw new Error('react-native Linking is not available');
|
|
52
52
|
}
|
|
53
53
|
try {
|
|
54
|
-
console.log('[ReactNativeAdapter]
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
if (!canOpen) {
|
|
58
|
-
console.error('[ReactNativeAdapter] Cannot open URL - no app found that handles tonconnect:// protocol');
|
|
59
|
-
throw new Error(`Cannot open URL: ${url}. Make sure a wallet app is installed that supports tonconnect:// protocol.`);
|
|
60
|
-
}
|
|
61
|
-
console.log('[ReactNativeAdapter] Opening URL...');
|
|
54
|
+
console.log('[ReactNativeAdapter] Opening URL:', url);
|
|
55
|
+
// CRITICAL FIX: Android'de canOpenURL() tonconnect:// protokolünü tanımayabilir
|
|
56
|
+
// Bu yüzden direkt openURL() çağırıyoruz. Eğer açılamazsa hata fırlatır.
|
|
62
57
|
await Linking.openURL(url);
|
|
63
58
|
console.log('[ReactNativeAdapter] URL opened successfully');
|
|
64
59
|
return true;
|
|
65
60
|
} catch (error: any) {
|
|
66
61
|
console.error('[ReactNativeAdapter] Error in openURL:', error);
|
|
67
|
-
//
|
|
68
|
-
|
|
69
|
-
|
|
62
|
+
// Android'de tonconnect:// protokolü tanınmıyorsa veya cüzdan yüklü değilse hata verir
|
|
63
|
+
const errorMessage = error?.message || String(error);
|
|
64
|
+
if (errorMessage.includes('No Activity found') || errorMessage.includes('No app found')) {
|
|
65
|
+
throw new Error(
|
|
66
|
+
'No TON wallet app found. Please install Tonkeeper or another TON Connect compatible wallet from Google Play Store.'
|
|
67
|
+
);
|
|
70
68
|
}
|
|
71
|
-
throw new Error(`Failed to open
|
|
69
|
+
throw new Error(`Failed to open wallet app: ${errorMessage}`);
|
|
72
70
|
}
|
|
73
71
|
}
|
|
74
72
|
|