{"id":33041,"date":"2024-03-08T12:48:17","date_gmt":"2024-03-08T04:48:17","guid":{"rendered":"https:\/\/app.applebyme.cn\/cloud\/appshangjia\/33041.html"},"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:\/\/app.applebyme.cn\/cloud\/appshangjia\/33041.html","title":{"rendered":"alert\u4e0a\u67b6app\u600e\u4e48\u505a?"},"content":{"rendered":"<p>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<p>\u4e00\u3001Alert\u4e0a\u67b6App\u7684\u539f\u7406<\/p>\n<p>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<p>\u4e8c\u3001Alert\u4e0a\u67b6App\u7684\u8be6\u7ec6\u6d41\u7a0b<\/p>\n<p>1. \u6ce8\u518cAlert\u8d26\u53f7<\/p>\n<p>\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<p>2. \u96c6\u6210Alert SDK<\/p>\n<p>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<p>\u4ee5iOS\u5e73\u53f0\u4e3a\u4f8b\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u901a\u8fc7CocoaPods\u96c6\u6210Alert SDK\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>pod &#8216;AlertSDK&#8217;<\/p>\n<p>&#8220;`<\/p>\n<p>\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<p>&#8220;`objective-c<\/p>\n<p>#import <\/p>\n<p><p>&#8211; (BOOL)application:(UIApplication *)applicatio<\/p>\n<p><figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/i.yimenyun.net\/2023-03\/31\/11\/33567600045.jpg\" \/><\/figure>\n<\/p>\n<p>n didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {<\/p>\n<p>    [AlertSDK registerWithApiKey:@&#8221;YOUR_API_KEY&#8221;];<\/p>\n<p>    return YES;<\/p>\n<p>}<\/p>\n<p>&#8220;`<\/p>\n<p>3. \u53d1\u9001\u4ea4\u6613<\/p>\n<p>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<p>\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<p>&#8220;`objective-c<\/p>\n<p>[AlertSDK sendTransactionWithTo:@&#8221;0x5B2063246F2191f18F2675ceDB8b28102e957458&#8243;<\/p>\n<p>                          value:@&#8221;0.1&#8243;<\/p>\n<p>                         nonce:@&#8221;1&#8243;<\/p>\n<p>                         chain:@&#8221;ETH&#8221;<\/p>\n<p>                       gasPrice:@&#8221;10&#8243;<\/p>\n<p>                       gasLimit:@&#8221;21000&#8243;<\/p>\n<p>                   privateKey:@&#8221;YOUR_PRIVATE_KEY&#8221;<\/p>\n<p>                  onSentBlock:^{<\/p>\n<p>                      NSLog(@&#8221;Transaction sent&#8221;);<\/p>\n<p>                  }<\/p>\n<p>                 onSuccessBlock:^(NSString * _Nonnull txHash) {<\/p>\n<p>                      NSLog(@&#8221;Transaction succeeded, txHash: %@&#8221;, txHash);<\/p>\n<p>                  }<\/p>\n<p>                   onFailBlock:^(NSError * _Nonnull error) {<\/p>\n<p>                      NSLog(@&#8221;Transaction failed, error: %@&#8221;, error);<\/p>\n<p>                  }<a href=\"https:\/\/www.applebyme.cn\/\">\u82f9\u679cApp\u5f00\u53d1<\/a>];<\/p>\n<p>&#8220;`<\/p>\n<p>4. \u63a5\u6536\u901a\u77e5<\/p>\n<p>\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<p>\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<p>&#8220;`objective-c<\/p>\n<p>[[NSNotificationCenter defaultCenter] addObserver:self<\/p>\n<p>                                         selector:@selector(didReceiveTransactionNotification:)<\/p>\n<p>                                             name:AlertTransactionNotification<\/p>\n<p>                                           object:nil];<\/p>\n<p>&#8211; (void)didReceiveTransactionNotification:(NSNotification *)notification {<\/p>\n<p>    AlertTransaction *transaction = notification.userInfo[AlertTransactionNotificationKey];<\/p>\n<p>    NSLog(@&#8221;Received transaction notification, hash: %@&#8221;, transaction.hash);<\/p>\n<p>}<\/p>\n<p>&#8220;`<\/p>\n<p>5. \u4e0a\u67b6App<\/p>\n<p>\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<p>\u4e09\u3001\u603b\u7ed3<\/p>\n<p>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":"<p>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":11,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[33251,562,3418,789,33250],"class_list":["post-33041","post","type-post","status-publish","format-standard","hentry","category-appshangjia","tag-storeapp","tag-562","tag-3418","tag-789","tag-app"],"_links":{"self":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/posts\/33041","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/comments?post=33041"}],"version-history":[{"count":0,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/posts\/33041\/revisions"}],"wp:attachment":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/media?parent=33041"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/categories?post=33041"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/tags?post=33041"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}