{"id":18535,"date":"2024-03-08T12:48:17","date_gmt":"2024-03-08T04:48:17","guid":{"rendered":"https:\/\/www.zhidianwl.net\/zhidianwl\/2024\/03\/08\/alert%e4%b8%8a%e6%9e%b6app%e6%80%8e%e4%b9%88%e5%81%9a\/"},"modified":"2024-03-08T12:48:17","modified_gmt":"2024-03-08T04:48:17","slug":"alert%e4%b8%8a%e6%9e%b6app%e6%80%8e%e4%b9%88%e5%81%9a","status":"publish","type":"post","link":"https:\/\/www.zhidianwl.net\/zhidianwl\/2024\/03\/08\/alert%e4%b8%8a%e6%9e%b6app%e6%80%8e%e4%b9%88%e5%81%9a\/","title":{"rendered":"alert\u4e0a\u67b6app\u600e\u4e48\u505a?"},"content":{"rendered":"

Alert\u662f\u4e00\u6b3e\u57fa\u4e8e\u533a\u5757\u94fe\u6280\u672f\u7684\u53bb\u4e2d\u5fc3\u5316\u5e94\u7528\uff08DApp\uff09\uff0c\u76ee\u524d\u5df2\u7ecf\u4e0a\u7ebf\u4e86\u591a\u4e2a\u4e3b\u6d41\u7684\u533a\u5757\u94fe\u5e73\u53f0\uff0c\u5982\u4ee5\u592a\u574a\u3001EOS\u3001TRON\u7b49\u3002Alert\u63d0\u4f9b\u4e86\u4e00\u79cd\u5168\u65b0\u7684\u901a\u77e5\u673a\u5236\uff0c\u7528\u6237\u53ef\u4ee5\u901a\u8fc7Alert\u6536\u5230\u6765\u81ea\u533a\u5757\u94fe\u4e0a\u7684\u5b9e\u65f6\u6d88\u606f\uff0c\u5982\u4ea4\u6613\u63d0\u9192\u3001\u8d44\u4ea7\u53d8\u52a8\u7b49\u3002\u672c\u6587\u5c06\u4ecb\u7ecdAlert\u4e0a\u67b6App\u7684\u539f\u7406\u548c\u8be6\u7ec6\u6d41\u7a0b\u3002<\/p>\n

\u4e00\u3001Alert\u4e0a\u67b6App\u7684\u539f\u7406<\/p>\n

Alert\u4e0a\u67b6App\u7684\u539f\u7406\u662f\u901a\u8fc7Alert\u63d0\u4f9b\u7684API\u63a5\u53e3\u5b9e\u73b0\u7684\u3002Alert\u63d0\u4f9b\u4e86\u4e00\u7cfb\u5217\u7684API\u63a5\u53e3\uff0c\u5305\u62ec\u83b7\u53d6\u8d26\u6237\u4fe1\u606f\u3001\u83b7\u53d6\u4ea4\u6613\u4fe1\u606f\u3001\u53d1\u9001\u4ea4\u6613\u7b49\u3002\u901a\u8fc7\u8fd9\u4e9bAPI\u63a5\u53e3\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u65b9\u4fbf\u5730\u4e0eAlert\u8fdb\u884c\u4ea4\u4e92\uff0c\u5b9e\u73b0App\u4e0eAlert\u7684\u65e0\u7f1d\u96c6\u6210\u3002<\/p>\n

\u4e8c\u3001Alert\u4e0a\u67b6App\u7684\u8be6\u7ec6\u6d41\u7a0b<\/p>\n

1. \u6ce8\u518cAlert\u8d26\u53f7<\/p>\n

\u9996\u5148\uff0c\u5f00\u53d1\u8005\u9700\u8981\u5728Alert\u5b98\u7f51\u4e0a\u6ce8\u518c\u4e00\u4e2a\u8d26\u53f7\u3002\u6ce8\u518c\u6210\u529f\u540e\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u83b7\u5f97\u4e00\u4e2a\u552f\u4e00\u7684API Key\uff0c\u7528\u4e8e\u4e0eAlert\u8fdb\u884c\u4ea4\u4e92\u3002<\/p>\n

2. \u96c6\u6210Alert SDK<\/p>\n

Alert\u63d0\u4f9b\u4e86\u4e00\u5957\u5b8c\u6574\u7684SDK\uff0c\u5305\u62eciOS\u3001Android\u3001Web\u7b49\u591a\u4e2a\u5e73\u53f0\u7684SDK\u3002\u5f00\u53d1\u8005\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7684\u9700\u6c42\u9009\u62e9\u76f8\u5e94\u7684SDK\u8fdb\u884c\u96c6\u6210\u3002<\/p>\n

\u4ee5iOS\u5e73\u53f0\u4e3a\u4f8b\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u901a\u8fc7CocoaPods\u96c6\u6210Alert SDK\uff1a<\/p>\n

“`<\/p>\n

pod ‘AlertSDK’<\/p>\n

“`<\/p>\n

\u96c6\u6210\u5b8c\u6210\u540e\uff0c\u5f00\u53d1\u8005\u9700\u8981\u5728\u9879\u76ee\u4e2d\u5f15\u5165Alert SDK\uff0c\u5e76\u521d\u59cb\u5316Alert SDK\uff1a<\/p>\n

“`objective-c<\/p>\n

#import <\/p>\n

– (BOOL)application:(UIApplication *)applicatio<\/p>\n

<\/figure>\n<\/p>\n

n didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {<\/p>\n

[AlertSDK registerWithApiKey:@”YOUR_API_KEY”];<\/p>\n

return YES;<\/p>\n

}<\/p>\n

“`<\/p>\n

3. \u53d1\u9001\u4ea4\u6613<\/p>\n

Alert\u63d0\u4f9b\u4e86\u4e00\u79cd\u5168\u65b0\u7684\u4ea4\u6613\u65b9\u5f0f\uff0c\u5373\u901a\u8fc7Alert\u53d1\u9001\u4ea4\u6613\u3002\u5f00\u53d1\u8005\u53ef\u4ee5\u901a\u8fc7Alert SDK\u53d1\u9001\u4ea4\u6613\uff0c\u5e76\u63a5\u6536\u4ea4\u6613\u7684\u7ed3\u679c\u3002<\/p>\n

\u4ee5\u4ee5\u592a\u574a\u4e3a\u4f8b\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u4ee3\u7801\u53d1\u9001\u4e00\u7b14\u4ee5\u592a\u574a\u4ea4\u6613\uff1a<\/p>\n

“`objective-c<\/p>\n

[AlertSDK sendTransactionWithTo:@”0x5B2063246F2191f18F2675ceDB8b28102e957458″<\/p>\n

value:@”0.1″<\/p>\n

nonce:@”1″<\/p>\n

chain:@”ETH”<\/p>\n

gasPrice:@”10″<\/p>\n

gasLimit:@”21000″<\/p>\n

privateKey:@”YOUR_PRIVATE_KEY”<\/p>\n

onSentBlock:^{<\/p>\n

NSLog(@”Transaction sent”);<\/p>\n

}<\/p>\n

onSuccessBlock:^(NSString * _Nonnull txHash) {<\/p>\n

NSLog(@”Transaction succeeded, txHash: %@”, txHash);<\/p>\n

}<\/p>\n

onFailBlock:^(NSError * _Nonnull error) {<\/p>\n

NSLog(@”Transaction failed, error: %@”, error);<\/p>\n

}\u82f9\u679cApp\u5f00\u53d1<\/a>];<\/p>\n

“`<\/p>\n

4. \u63a5\u6536\u901a\u77e5<\/p>\n

\u5f00\u53d1\u8005\u53ef\u4ee5\u901a\u8fc7Alert SDK\u63a5\u6536\u6765\u81eaAlert\u7684\u901a\u77e5\u3002Alert\u63d0\u4f9b\u4e86\u591a\u79cd\u901a\u77e5\u7c7b\u578b\uff0c\u5305\u62ec\u4ea4\u6613\u901a\u77e5\u3001\u8d44\u4ea7\u53d8\u52a8\u901a\u77e5\u7b49\u3002\u5f00\u53d1\u8005\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7684\u9700\u6c42\u9009\u62e9\u76f8\u5e94\u7684\u901a\u77e5\u7c7b\u578b\u3002<\/p>\n

\u4ee5iOS\u5e73\u53f0\u4e3a\u4f8b\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u4ee3\u7801\u63a5\u6536\u6765\u81eaAlert\u7684\u4ea4\u6613\u901a\u77e5\uff1a<\/p>\n

“`objective-c<\/p>\n

[[NSNotificationCenter defaultCenter] addObserver:self<\/p>\n

selector:@selector(didReceiveTransactionNotification:)<\/p>\n

name:AlertTransactionNotification<\/p>\n

object:nil];<\/p>\n

– (void)didReceiveTransactionNotification:(NSNotification *)notification {<\/p>\n

AlertTransaction *transaction = notification.userInfo[AlertTransactionNotificationKey];<\/p>\n

NSLog(@”Received transaction notification, hash: %@”, transaction.hash);<\/p>\n

}<\/p>\n

“`<\/p>\n

5. \u4e0a\u67b6App<\/p>\n

\u5f00\u53d1\u8005\u5728\u5b8c\u6210Alert\u96c6\u6210\u540e\uff0c\u53ef\u4ee5\u5c06App\u4e0a\u67b6\u5230\u5e94\u7528\u5546\u5e97\u3002\u7528\u6237\u4e0b\u8f7d\u5e76\u5b89\u88c5App\u540e\uff0c\u5c31\u53ef\u4ee5\u901a\u8fc7Alert\u63a5\u6536\u6765\u81ea\u533a\u5757\u94fe\u4e0a\u7684\u5b9e\u65f6\u6d88\u606f\u3002<\/p>\n

\u4e09\u3001\u603b\u7ed3<\/p>\n

Alert\u662f\u4e00\u6b3e\u57fa\u4e8e\u533a\u5757\u94fe\u6280\u672f\u7684\u53bb\u4e2d\u5fc3\u5316\u5e94\u7528\uff0c\u63d0\u4f9b\u4e86\u4e00\u79cd\u5168\u65b0\u7684\u901a\u77e5\u673a\u5236\u3002\u5f00\u53d1\u8005\u53ef\u4ee5\u901a\u8fc7Alert\u63d0\u4f9b\u7684API\u63a5\u53e3\uff0c\u5b9e\u73b0App\u4e0eAlert\u7684\u65e0\u7f1d\u96c6\u6210\u3002\u672c\u6587\u4ecb\u7ecd\u4e86Alert\u4e0a\u67b6App\u7684\u539f\u7406\u548c\u8be6\u7ec6\u6d41\u7a0b\uff0c\u5e0c\u671b\u53ef\u4ee5\u5bf9\u5f00\u53d1\u8005\u6709\u6240\u5e2e\u52a9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

Alert\u662f\u4e00\u6b3e\u57fa\u4e8e\u533a\u5757\u94fe\u6280\u672f\u7684\u53bb\u4e2d\u5fc3\u5316\u5e94\u7528\uff08DApp\uff09\uff0c\u76ee\u524d\u5df2\u7ecf\u4e0a\u7ebf\u4e86\u591a\u4e2a\u4e3b\u6d41\u7684\u533a\u5757\u94fe\u5e73\u53f0\uff0c\u5982\u4ee5\u592a\u574a\u3001EOS\u3001TRON\u7b49\u3002Alert\u63d0\u4f9b\u4e86\u4e00\u79cd\u5168\u65b0\u7684\u901a\u77e5\u673a\u5236\uff0c\u7528\u6237\u53ef\u4ee5\u901a\u8fc7Alert\u6536\u5230\u6765\u81ea\u533a\u5757\u94fe\u4e0a<\/p>\n","protected":false},"author":20,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[21022,360,163,56,21021],"topic":[],"class_list":["post-18535","post","type-post","status-publish","format-standard","hentry","category-appsjsd","tag-storeapp","tag-360","tag-163","tag-56","tag-app"],"_links":{"self":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts\/18535","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/users\/20"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/comments?post=18535"}],"version-history":[{"count":0,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/posts\/18535\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/media?parent=18535"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/categories?post=18535"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/tags?post=18535"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.zhidianwl.net\/zhidianwl\/wp-json\/wp\/v2\/topic?post=18535"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}