{"id":343630,"date":"2023-01-07T21:02:04","date_gmt":"2023-01-07T21:02:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=343630"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=343630","title":{"rendered":"<span>Flutter + In-App Purchases<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u043c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0410\u043b\u0435\u043a\u0441\u0435\u0439. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u0440\u043e \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u043f\u043e\u043a\u0443\u043f\u043e\u043a \u0432 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430\u00a0<a href=\"https:\/\/flutter.dev\/\" rel=\"noopener noreferrer nofollow\"><u>Flutter<\/u><\/a>\u00a0\u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/pub.dev\/packages\/in_app_purchase\" rel=\"noopener noreferrer nofollow\">\u043f\u043b\u0430\u0433\u0438\u043d\u0430 In-App Purchase<\/a>. <\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e \u0441\u0430\u043c\u0438\u0445 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u0430\u0445 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0434\u0430\u0432\u0430\u0442\u044c \u0447\u0442\u043e\u0431 \u043f\u043e\u0442\u043e\u043c \u043d\u0435 \u0431\u044b\u043b\u043e \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432. <br \/>\u0415\u0441\u0442\u044c 3 \u0442\u0438\u043f\u0430 \u043f\u043b\u0430\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430:<br \/>1. \u0420\u0430\u0441\u0445\u043e\u0434\u0443\u0435\u043c\u044b\u0435 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u044b (\u043c\u043e\u043d\u0435\u0442\u044b, \u043a\u0440\u0438\u0441\u0442\u0430\u043b\u043b\u044b, \u043f\u0430\u0442\u0440\u043e\u043d\u044b \u0438 \u0442\u043f).<br \/>2. \u041d\u0435\u0440\u0430\u0441\u0445\u043e\u0434\u0443\u0435\u043c\u044b\u0435 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u044b (\u0430\u0432\u0430\u0442\u0430\u0440\u044b, \u043a\u043e\u0441\u0442\u044e\u043c\u044b, \u0438 \u0442\u043f. \u0442.\u0435. \u0432\u0441\u0435 \u0442\u043e \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043a\u0443\u043f\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437).<br \/>3. \u041f\u043e\u0434\u043f\u0438\u0441\u043a\u0438 (\u043d\u0443 \u0442\u0443\u0442 \u0432\u0441\u0435 \u0438 \u0442\u0430\u043a \u043f\u043e\u043d\u044f\u0442\u043d\u043e).<\/p>\n<h2>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 iOS<\/h2>\n<p>\u041c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0447\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f <a href=\"https:\/\/developer.apple.com\/in-app-purchase\/\" rel=\"noopener noreferrer nofollow\">\u043e\u0444\u0444 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u044d\u043f\u043b<\/a>,  \u043d\u043e \u043e\u043d\u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043d\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u0430 \u0434\u043b\u044f \u043c\u0435\u043d\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0447\u0442\u043e \u043d\u0430\u0434\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0437 \u0441\u0432\u043e\u0435\u0433\u043e \u043e\u043f\u044b\u0442\u0430) <\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u0438\u0434\u0435\u043c \u0432 <a href=\"https:\/\/appstoreconnect.apple.com\/\" rel=\"noopener noreferrer nofollow\">AppstoreConnect<\/a>, \u00a0 \u0442\u0430\u043c \u0432 \u0432\u0435\u0440\u0445\u043d\u0435\u043c \u043c\u0435\u043d\u044e \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c <a href=\"https:\/\/appstoreconnect.apple.com\/agreements\/#\/\" rel=\"noopener noreferrer nofollow\">agreements(\u0421\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044f)<\/a> \u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435 \u043e &#171;\u041f\u043b\u0430\u0442\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u0438 \u043f\u043e\u043a\u0443\u043f\u043a\u0430\u0445 \u0432 \u043d\u0438\u0445&#187;. \u043f.\u0441. \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043b\u0430\u0434\u0435\u043b\u0435\u0446 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430!<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u0435\u0434\u0435\u043c \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0441\u0442\u043e\u0440\u0435 \u0438 \u0432 \u0431\u043e\u043a\u043e\u0432\u043e\u043c \u043c\u0435\u043d\u044e \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u0443\u043d\u043a\u0442 In-App Purchases \u0438\u043b\u0438 Subscriptions \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e \u043a\u0430\u043a\u043e\u0439 \u043f\u0440\u043e\u0434\u0443\u043a\u0442 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u0440\u043e\u0434\u0430\u0432\u0430\u0442\u044c.<br \/>\u042f \u0431\u0443\u0434\u0443 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u043e\u043d\u0435\u0442.<br \/>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u0443\u043d\u043a\u0442 In-App Purchases \u0438 \u0432 \u043e\u0442\u043a\u0440\u044b\u0432\u0448\u0435\u043c\u0441\u044f \u043e\u043a\u043d\u0435 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c + \u0438 \u0432\u0438\u0434\u0438\u043c \u0442\u0430\u043a\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u0443.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/324\/4e6\/32d\/3244e632d717f6f65368127fb1fa5601.png\" width=\"700\" height=\"481\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/324\/4e6\/32d\/3244e632d717f6f65368127fb1fa5601.png\"\/><figcaption><\/figcaption><\/figure>\n<blockquote>\n<p>Type &#8212; \u044d\u0442\u043e \u0440\u0430\u0441\u0445\u043e\u0434\u0443\u0435\u043c\u044b\u0439 \u0438\u043b\u0438 \u043d\u0435\u0440\u0430\u0441\u0445\u043e\u0434\u0443\u0435\u043c\u044b\u0439 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b<br \/>Name &#8212; \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c\u043e\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u0432 AppStoreConnect<br \/>Id &#8212; \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/p>\n<\/blockquote>\n<p>\u041d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438 \u0432\u0438\u0434\u0438\u043c \u043e\u043a\u043d\u043e \u0441 \u043d\u0430\u0448\u0438\u043c \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u043c, \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0446\u0435\u043d\u0443 \u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c\u043e\u0435 \u0432 \u0441\u0430\u043c\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/599\/beb\/6c9\/599beb6c9304264e485018cc1ffcbb53.png\" width=\"1226\" height=\"191\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/599\/beb\/6c9\/599beb6c9304264e485018cc1ffcbb53.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e \u0446\u0435\u043d\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0432 \u044d\u0442\u043e\u043c \u043f\u043e\u043b\u0435 \u0438\u0437 \u0434\u0440\u043e\u043f\u0434\u0430\u0443\u043d\u0430 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043d\u0443\u0436\u043d\u0443\u044e \u0438 \u0432\u0441\u0435 (\u0435\u0441\u043b\u0438 \u043d\u0430\u0434\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043a\u0438\u0434\u043a\u0443 \u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043f\u0435\u0440\u0438\u043e\u0434 \u043d\u0430\u0436\u0430\u0432 + \u0432 \u044d\u0442\u043e\u043c \u043f\u043e\u043b\u0435)<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u044b \u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b87\/3be\/5c5\/b873be5c52224e63bd6e8c4cec15d0d5.png\" width=\"1196\" height=\"261\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b87\/3be\/5c5\/b873be5c52224e63bd6e8c4cec15d0d5.png\"\/><figcaption><\/figcaption><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f84\/be2\/970\/f84be2970fb280c237374718d5ed8d55.png\" width=\"701\" height=\"394\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f84\/be2\/970\/f84be2970fb280c237374718d5ed8d55.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412\u0438\u0434\u0438\u043c \u0442\u0430\u043a\u043e\u0435 \u043c\u0435\u043d\u044e<\/p>\n<blockquote>\n<p><strong>Localization &#8212; \u043d\u0443 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u043a\u0430\u043a\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 \u043f\u0435\u0440\u0435\u0432\u043e\u0434<br \/>Display Name &#8212;  \u044d\u0442\u043e \u043f\u043e\u043b\u0435 \u043c\u044b \u043f\u043e\u0442\u043e\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043a\u0430\u043a \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435<br \/>Description &#8212; \u044d\u0442\u043e \u043f\u043e\u043b\u0435 \u043c\u044b \u043f\u043e\u0442\u043e\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043a\u0430\u043a \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430<\/strong><\/p>\n<\/blockquote>\n<p>\u0412\u0441\u0435 \u0434\u0430\u043b\u0435\u0435 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u0432\u0435\u0440\u0445\u043d\u0435\u043c \u043f\u0440\u0430\u0432\u043e\u043c \u0443\u0433\u043b\u0443 \u0438 \u0433\u043e\u0442\u043e\u0432\u043e \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043d\u0430\u0448 \u043f\u0440\u043e\u0434\u0443\u043a\u0442! <br \/>\u041c\u043e\u0436\u0435\u043c \u043f\u043e\u0432\u0442\u043e\u0442\u0440\u0438\u0442\u044c \u0432\u0441\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0435 \u043d\u0430\u043c \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u044b!<\/p>\n<h2>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Android<\/h2>\n<p>\u0412\u0441\u0435 \u0442\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0447\u0442\u043e \u0438 \u0434\u043b\u044f iOS \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0449\u0435 ) <\/p>\n<p> \u0417\u0430\u0445\u043e\u0434\u0438\u043c  \u043d\u0430 <a href=\"https:\/\/play.google.com\/console\/\" rel=\"noopener noreferrer nofollow\">https:\/\/play.google.com\/console\/<\/a>  \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043d\u0443\u0436\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u0430\u043b\u0435\u0435 \u0432 \u043f\u0440\u0430\u0432\u043e\u043c \u043c\u0435\u043d\u044e \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u044b->\u043f\u0440\u043e\u0434\u0443\u043a\u0442\u044b \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0438 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0434\u0443\u043a\u0442.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/399\/224\/9b2\/3992249b24d98a791d8178b6a195a881.png\" alt=\"\" title=\"\" width=\"3818\" height=\"1548\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/399\/224\/9b2\/3992249b24d98a791d8178b6a195a881.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u043e\u0442\u043a\u0440\u044b\u0432\u0448\u0435\u043c\u0441\u044f \u043e\u043a\u043d\u0435 \u0432\u0432\u043e\u0434\u0438\u043c ID \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430,  \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 ,\u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435, \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0446\u0435\u043d\u0443.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/961\/62a\/412\/96162a4126a0553e6112a327bbacb006.png\" width=\"1760\" height=\"1684\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/961\/62a\/412\/96162a4126a0553e6112a327bbacb006.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412\u0441\u0435! \u041d\u0430 \u044d\u0442\u043e\u043c \u0441\u043e \u0441\u0442\u043e\u0440\u0430\u043c\u0438 \u043c\u044b \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438.<\/p>\n<h2>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h2>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043f\u0430\u043a\u0435\u0442 \u0434\u043b\u044f \u043f\u043b\u0430\u0442\u0435\u0436\u0435\u0439<\/p>\n<pre><code>flutter pub add in_app_purchase<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0435\u0440\u0432\u0438\u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043d\u0430\u0448\u0438 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438 \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043c<br \/>\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043d\u0435\u0433\u043e \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435.<\/p>\n<pre><code class=\"dart\">class InAppPurchaseService {   final InAppPurchase _inAppPurchase = InAppPurchase.instance;   final Stream&lt;List&lt;PurchaseDetails>> _storeSubscription =       InAppPurchase.instance.purchaseStream;    InAppPurchase get instance => _inAppPurchase; }<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043a\u0438 \u0441 \u0430\u0439\u0434\u0438\u043d\u0448\u0438\u043a\u0430\u043c\u0438 \u043d\u0430\u0448\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432 \u0441\u0442\u043e\u0440\u0435 \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c \u0438\u0445 \u0438\u0437 \u0441\u0442\u043e\u0440\u0430.<\/p>\n<pre><code class=\"dart\"> static const Set&lt;String> coins = {     '70_coins',     '350_coins',     '700_coins',     '1400_coins',     '3500_coins',     '7000_coins',     '17500_coins',   };<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 \u0438\u0437 \u0441\u0442\u043e\u0440\u0430<\/p>\n<pre><code class=\"dart\">Future&lt;List&lt;ProductDetails>> getProductsByType(StoreItemType type) async {     final Set&lt;String> productsIds;      switch (type) {       case StoreItemType.coins:         productsIds = StoreProductsIds.coins;         break;       case StoreItemType.subscription:         productsIds = StoreProductsIds.subscriptions;         break;     }      final bool isAvailable = await _inAppPurchase.isAvailable();     if (!isAvailable) {       return [];     }      final ProductDetailsResponse productDetailResponse =         await _inAppPurchase.queryProductDetails(productsIds);      if (productDetailResponse.error != null ||         productDetailResponse.productDetails.isEmpty) {       return [];     }      return productDetailResponse.productDetails;   }<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432  \u0432 \u0442\u0430\u043a\u043e\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0435.<\/p>\n<pre><code class=\"dart\">class ProductDetails {   \/\/\/ Creates a new product details object with the provided details.   ProductDetails({     required this.id,     required this.title,     required this.description,     required this.price,     required this.rawPrice,     required this.currencyCode,     this.currencySymbol = '',   });    \/\/\/ The identifier of the product.   \/\/\/   \/\/\/ For example, on iOS it is specified in App Store Connect; on Android, it is specified in Google Play Console.   final String id;    \/\/\/ The title of the product.   \/\/\/   \/\/\/ For example, on iOS it is specified in App Store Connect; on Android, it is specified in Google Play Console.   final String title;    \/\/\/ The description of the product.   \/\/\/   \/\/\/ For example, on iOS it is specified in App Store Connect; on Android, it is specified in Google Play Console.   final String description;    \/\/\/ The price of the product, formatted with currency symbol (\"$0.99\").   \/\/\/   \/\/\/ For example, on iOS it is specified in App Store Connect; on Android, it is specified in Google Play Console.   final String price;    \/\/\/ The unformatted price of the product, specified in the App Store Connect or Sku in Google Play console based on the platform.   \/\/\/ The currency unit for this value can be found in the [currencyCode] property.   \/\/\/ The value always describes full units of the currency. (e.g. 2.45 in the case of $2.45)   final double rawPrice;    \/\/\/ The currency code for the price of the product.   \/\/\/ Based on the price specified in the App Store Connect or Sku in Google Play console based on the platform.   final String currencyCode;    \/\/\/ The currency symbol for the locale, e.g. $ for US locale.   \/\/\/   \/\/\/ When the currency symbol cannot be determined, the ISO 4217 currency code is returned.   final String currencySymbol; }<\/code><\/pre>\n<p>\u0422\u0430\u043a \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438,  \u043d\u043e \u043d\u0430\u0434\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u043a\u0430\u043a-\u0442\u043e \u0438\u0445 \u043a\u0443\u043f\u0438\u0442\u044c.<\/p>\n<p>\u0422\u0443\u0442 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u043a\u043b\u0430\u0441\u0441 \u043f\u0440\u043e\u0441\u043b\u043e\u0439\u043a\u0443 \u0434\u043b\u044f \u0445\u0435\u043d\u0434\u043b\u0438\u043d\u0433\u0430 \u0432\u0441\u0435\u0445 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0439 \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043c. \u0414\u0435\u043b\u043e \u0432\u043e\u0442 \u0432 \u0447\u0435\u043c \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 \u043e \u043f\u043e\u043a\u0443\u043f\u043a\u0435 \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u043f\u043e\u043a\u0443\u043f\u043a\u0443 \u043f\u043e\u0441\u043b\u0435. \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u043e\u0434\u043b\u0438\u043d\u043d\u043e\u0441\u0442\u0438 \u043f\u043b\u0430\u0442\u0435\u0436\u0430 \u043d\u0430 \u0431\u044d\u043a\u0435!  \u0415\u0441\u043b\u0438 \u043c\u044b \u043d\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043c \u043f\u043e\u043a\u0443\u043f\u043a\u0443 \u0434\u0435\u043d\u044c\u0433\u0438 \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043f\u043e\u043a\u0443\u043f\u0430\u0442\u0435\u043b\u044e \u0447\u0435\u0440\u0435\u0437 3 \u0434\u043d\u044f.  \u0418 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u0447\u0438\u0442\u0430\u0442\u044c\u0441\u044f \u043e\u0442\u043c\u0435\u043d\u0435\u043d\u043d\u043e\u0439. <\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043b\u0430\u0441\u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0445\u044d\u043d\u0434\u043b\u0438\u0442 \u0432\u0441\u0435 \u0441\u0442\u0435\u0439\u0442\u044b \u043f\u043b\u0430\u0442\u0435\u0436\u0435\u0439:<\/p>\n<pre><code class=\"dart\"> class PurchaseDetailsStreamSubscription {   final InAppPurchaseService inAppPurchaseService = Get.find&lt;InAppPurchaseService>();   final Function()? onPending;   final Function(PurchaseDetails purchaseDetails)? onPurchased;   final Function()? onError;   final Function()? onRestored;   final Function()? onCanceled;    StreamSubscription&lt;List&lt;PurchaseDetails>>? _streamSubscription;   PurchaseDetailsStreamSubscription({     this.onPending,     this.onPurchased,     this.onError,     this.onRestored,     this.onCanceled,   });    Future&lt;void> init() async {     _streamSubscription = inAppPurchaseService.getStoreSubscription().listen(       (List&lt;PurchaseDetails> events) {         Future.forEach(           events,           (PurchaseDetails purchaseDetails) async {             if (purchaseDetails.pendingCompletePurchase) {               await inAppPurchaseService.completePurchase(purchaseDetails);             }             switch (purchaseDetails.status) {               case PurchaseStatus.pending:                 onPending?.call();                 break;               case PurchaseStatus.purchased:                 onPurchased?.call(purchaseDetails);                 break;               case PurchaseStatus.error:                 onError?.call();                 break;               case PurchaseStatus.restored:                 onRestored?.call();                 break;               case PurchaseStatus.canceled:                 onCanceled?.call();                 break;             }           },         );       },     );   }    void close() {     _streamSubscription?.cancel();   } } <\/code><\/pre>\n<p> \u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0435\u0449\u0435 \u0434\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u0435 \u0434\u043b\u044f \u043f\u043e\u043a\u0443\u043f\u043e\u043a.<\/p>\n<pre><code class=\"dart\">Future&lt;bool> buyItemInStore(ProductDetails product) async {     final PurchaseParam purchaseParam = PurchaseParam(productDetails: product);     return InAppPurchase.instance.buyConsumable(purchaseParam: purchaseParam);   }    Future&lt;void> completePurchase(PurchaseDetails purchaseDetails) async {     await InAppPurchase.instance.completePurchase(purchaseDetails);   }<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u043a\u0430\u043a \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u043f\u043e\u043a\u0443\u043f\u043a\u0443 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b, \u0432\u0442\u043e\u0440\u043e\u0439 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u043f\u043e\u043a\u0443\u043f\u043a\u0443.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432 BloC \u0438\u043b\u0438 \u0433\u0434\u0435 \u0432\u0430\u043c \u0442\u0430\u043c \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0448 \u043a\u043b\u0430\u0441\u0441 \u043f\u0440\u043e\u0441\u043b\u043e\u0439\u043a\u0443 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0432 \u043d\u0435\u0433\u043e \u0442\u0430\u043a\u043e\u0435 <\/p>\n<pre><code class=\"dart\">purchaseDetailsStreamSubscription = PurchaseDetailsStreamSubscription(       onCanceled: closeLoader,       onError: closeLoader,       onPurchased: (PurchaseDetails purchaseDetails) async {         closeLoader();         try {           \/\/ \u0442\u0443\u0442 \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043d\u0430\u0448 \u043f\u043b\u0430\u0442\u0435\u0436 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0432 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043f\u043b\u0430\u0442\u0435\u0436\u0435 ,            \/\/ \u0438 \u0435\u0441\u043b\u0438 \u0432\u0441\u0435 \u043e\u043a \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u043c  \u043f\u043e\u043a\u0443\u043f\u043a\u0443           final bool res = await transactionRepository               .createTransaction(purchaseDetails.verificationData.serverVerificationData);           if (res) {             await inAppPurchaseService.completePurchase(purchaseDetails);             await updateBalance();           }         } catch (_, __) {}       },     )..init();<\/code><\/pre>\n<p>\u0412\u0441\u0435 \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u043f\u043e\u043a\u0443\u043f\u043a\u0443 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0437\u0432\u0430\u0432 \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434!<\/p>\n<pre><code class=\"dart\">inAppPurchaseService.buyItemInStore(item);<\/code><\/pre>\n<p>\u0421 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0430\u043c\u0438 \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u0442\u0430\u043a\u0430\u044f \u0436\u0435 \u0438\u0441\u0442\u043e\u0440\u0438\u044f, \u0430 \u0432\u043e\u0442 \u0441 \u043d\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u0443\u0435\u043c\u044b\u043c\u0438 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430\u043c \u043d\u0430\u0434\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 .<\/p>\n<pre><code>buyNonConsumable<\/code><\/pre>\n<p>\u041a\u0430\u043a-\u0442\u043e \u0442\u0430\u043a! \u0412\u0441\u0435\u043c \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435! <\/p>\n<\/p>\n<p>P.S. \u0435\u0441\u043b\u0438 \u0447\u0442\u043e \u043d\u0435 \u0442\u0430\u043a, \u043f\u043e\u043f\u0440\u0430\u0432\u044c\u0442\u0435 \u043f\u043b\u0438\u0437 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0445!) \u0441\u043f\u0430\u0441\u0438\u0431\u043e)<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/709400\/\"> https:\/\/habr.com\/ru\/post\/709400\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u043c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0410\u043b\u0435\u043a\u0441\u0435\u0439. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u0440\u043e \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u043f\u043e\u043a\u0443\u043f\u043e\u043a \u0432 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430\u00a0<a href=\"https:\/\/flutter.dev\/\" rel=\"noopener noreferrer nofollow\"><u>Flutter<\/u><\/a>\u00a0\u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/pub.dev\/packages\/in_app_purchase\" rel=\"noopener noreferrer nofollow\">\u043f\u043b\u0430\u0433\u0438\u043d\u0430 In-App Purchase<\/a>. <\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e \u0441\u0430\u043c\u0438\u0445 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u0430\u0445 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0434\u0430\u0432\u0430\u0442\u044c \u0447\u0442\u043e\u0431 \u043f\u043e\u0442\u043e\u043c \u043d\u0435 \u0431\u044b\u043b\u043e \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432. <br \/>\u0415\u0441\u0442\u044c 3 \u0442\u0438\u043f\u0430 \u043f\u043b\u0430\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430:<br \/>1. \u0420\u0430\u0441\u0445\u043e\u0434\u0443\u0435\u043c\u044b\u0435 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u044b (\u043c\u043e\u043d\u0435\u0442\u044b, \u043a\u0440\u0438\u0441\u0442\u0430\u043b\u043b\u044b, \u043f\u0430\u0442\u0440\u043e\u043d\u044b \u0438 \u0442\u043f).<br \/>2. \u041d\u0435\u0440\u0430\u0441\u0445\u043e\u0434\u0443\u0435\u043c\u044b\u0435 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u044b (\u0430\u0432\u0430\u0442\u0430\u0440\u044b, \u043a\u043e\u0441\u0442\u044e\u043c\u044b, \u0438 \u0442\u043f. \u0442.\u0435. \u0432\u0441\u0435 \u0442\u043e \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043a\u0443\u043f\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437).<br \/>3. \u041f\u043e\u0434\u043f\u0438\u0441\u043a\u0438 (\u043d\u0443 \u0442\u0443\u0442 \u0432\u0441\u0435 \u0438 \u0442\u0430\u043a \u043f\u043e\u043d\u044f\u0442\u043d\u043e).<\/p>\n<h2>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 iOS<\/h2>\n<p>\u041c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0447\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f <a href=\"https:\/\/developer.apple.com\/in-app-purchase\/\" rel=\"noopener noreferrer nofollow\">\u043e\u0444\u0444 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u044d\u043f\u043b<\/a>,  \u043d\u043e \u043e\u043d\u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043d\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u0430 \u0434\u043b\u044f \u043c\u0435\u043d\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0447\u0442\u043e \u043d\u0430\u0434\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0437 \u0441\u0432\u043e\u0435\u0433\u043e \u043e\u043f\u044b\u0442\u0430) <\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u0438\u0434\u0435\u043c \u0432 <a href=\"https:\/\/appstoreconnect.apple.com\/\" rel=\"noopener noreferrer nofollow\">AppstoreConnect<\/a>, \u00a0 \u0442\u0430\u043c \u0432 \u0432\u0435\u0440\u0445\u043d\u0435\u043c \u043c\u0435\u043d\u044e \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c <a href=\"https:\/\/appstoreconnect.apple.com\/agreements\/#\/\" rel=\"noopener noreferrer nofollow\">agreements(\u0421\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044f)<\/a> \u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435 \u043e &#171;\u041f\u043b\u0430\u0442\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u0438 \u043f\u043e\u043a\u0443\u043f\u043a\u0430\u0445 \u0432 \u043d\u0438\u0445&#187;. \u043f.\u0441. \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043b\u0430\u0434\u0435\u043b\u0435\u0446 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430!<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u0435\u0434\u0435\u043c \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0441\u0442\u043e\u0440\u0435 \u0438 \u0432 \u0431\u043e\u043a\u043e\u0432\u043e\u043c \u043c\u0435\u043d\u044e \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u0443\u043d\u043a\u0442 In-App Purchases \u0438\u043b\u0438 Subscriptions \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e \u043a\u0430\u043a\u043e\u0439 \u043f\u0440\u043e\u0434\u0443\u043a\u0442 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u0440\u043e\u0434\u0430\u0432\u0430\u0442\u044c.<br \/>\u042f \u0431\u0443\u0434\u0443 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u043e\u043d\u0435\u0442.<br \/>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u0443\u043d\u043a\u0442 In-App Purchases \u0438 \u0432 \u043e\u0442\u043a\u0440\u044b\u0432\u0448\u0435\u043c\u0441\u044f \u043e\u043a\u043d\u0435 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c + \u0438 \u0432\u0438\u0434\u0438\u043c \u0442\u0430\u043a\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u0443.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<blockquote>\n<p>Type &#8212; \u044d\u0442\u043e \u0440\u0430\u0441\u0445\u043e\u0434\u0443\u0435\u043c\u044b\u0439 \u0438\u043b\u0438 \u043d\u0435\u0440\u0430\u0441\u0445\u043e\u0434\u0443\u0435\u043c\u044b\u0439 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b<br \/>Name &#8212; \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c\u043e\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u0432 AppStoreConnect<br \/>Id &#8212; \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/p>\n<\/blockquote>\n<p>\u041d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438 \u0432\u0438\u0434\u0438\u043c \u043e\u043a\u043d\u043e \u0441 \u043d\u0430\u0448\u0438\u043c \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u043c, \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0446\u0435\u043d\u0443 \u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c\u043e\u0435 \u0432 \u0441\u0430\u043c\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e \u0446\u0435\u043d\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0432 \u044d\u0442\u043e\u043c \u043f\u043e\u043b\u0435 \u0438\u0437 \u0434\u0440\u043e\u043f\u0434\u0430\u0443\u043d\u0430 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043d\u0443\u0436\u043d\u0443\u044e \u0438 \u0432\u0441\u0435 (\u0435\u0441\u043b\u0438 \u043d\u0430\u0434\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043a\u0438\u0434\u043a\u0443 \u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043f\u0435\u0440\u0438\u043e\u0434 \u043d\u0430\u0436\u0430\u0432 + \u0432 \u044d\u0442\u043e\u043c \u043f\u043e\u043b\u0435)<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u044b \u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e <\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u0438\u0434\u0438\u043c \u0442\u0430\u043a\u043e\u0435 \u043c\u0435\u043d\u044e<\/p>\n<blockquote>\n<p><strong>Localization &#8212; \u043d\u0443 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u043a\u0430\u043a\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 \u043f\u0435\u0440\u0435\u0432\u043e\u0434<br \/>Display Name &#8212;  \u044d\u0442\u043e \u043f\u043e\u043b\u0435 \u043c\u044b \u043f\u043e\u0442\u043e\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043a\u0430\u043a \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435<br \/>Description &#8212; \u044d\u0442\u043e \u043f\u043e\u043b\u0435 \u043c\u044b \u043f\u043e\u0442\u043e\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043a\u0430\u043a \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430<\/strong><\/p>\n<\/blockquote>\n<p>\u0412\u0441\u0435 \u0434\u0430\u043b\u0435\u0435 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u0432\u0435\u0440\u0445\u043d\u0435\u043c \u043f\u0440\u0430\u0432\u043e\u043c \u0443\u0433\u043b\u0443 \u0438 \u0433\u043e\u0442\u043e\u0432\u043e \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043d\u0430\u0448 \u043f\u0440\u043e\u0434\u0443\u043a\u0442! <br \/>\u041c\u043e\u0436\u0435\u043c \u043f\u043e\u0432\u0442\u043e\u0442\u0440\u0438\u0442\u044c \u0432\u0441\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0435 \u043d\u0430\u043c \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u044b!<\/p>\n<h2>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Android<\/h2>\n<p>\u0412\u0441\u0435 \u0442\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0447\u0442\u043e \u0438 \u0434\u043b\u044f iOS \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0449\u0435 ) <\/p>\n<p> \u0417\u0430\u0445\u043e\u0434\u0438\u043c  \u043d\u0430 <a href=\"https:\/\/play.google.com\/console\/\" rel=\"noopener noreferrer nofollow\">https:\/\/play.google.com\/console\/<\/a>  \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043d\u0443\u0436\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u0430\u043b\u0435\u0435 \u0432 \u043f\u0440\u0430\u0432\u043e\u043c \u043c\u0435\u043d\u044e \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u044b->\u043f\u0440\u043e\u0434\u0443\u043a\u0442\u044b \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0438 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0434\u0443\u043a\u0442.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u043e\u0442\u043a\u0440\u044b\u0432\u0448\u0435\u043c\u0441\u044f \u043e\u043a\u043d\u0435 \u0432\u0432\u043e\u0434\u0438\u043c ID \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430,  \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 ,\u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435, \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0446\u0435\u043d\u0443.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u0441\u0435! \u041d\u0430 \u044d\u0442\u043e\u043c \u0441\u043e \u0441\u0442\u043e\u0440\u0430\u043c\u0438 \u043c\u044b \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438.<\/p>\n<h2>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h2>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043f\u0430\u043a\u0435\u0442 \u0434\u043b\u044f \u043f\u043b\u0430\u0442\u0435\u0436\u0435\u0439<\/p>\n<pre><code>flutter pub add in_app_purchase<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0435\u0440\u0432\u0438\u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043d\u0430\u0448\u0438 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438 \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043c<br \/>\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043d\u0435\u0433\u043e \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435.<\/p>\n<pre><code class=\"dart\">class InAppPurchaseService {   final InAppPurchase _inAppPurchase = InAppPurchase.instance;   final Stream&lt;List&lt;PurchaseDetails>> _storeSubscription =       InAppPurchase.instance.purchaseStream;    InAppPurchase get instance => _inAppPurchase; }<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043a\u0438 \u0441 \u0430\u0439\u0434\u0438\u043d\u0448\u0438\u043a\u0430\u043c\u0438 \u043d\u0430\u0448\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432 \u0441\u0442\u043e\u0440\u0435 \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c \u0438\u0445 \u0438\u0437 \u0441\u0442\u043e\u0440\u0430.<\/p>\n<pre><code class=\"dart\"> static const Set&lt;String> coins = {     '70_coins',     '350_coins',     '700_coins',     '1400_coins',     '3500_coins',     '7000_coins',     '17500_coins',   };<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 \u0438\u0437 \u0441\u0442\u043e\u0440\u0430<\/p>\n<pre><code class=\"dart\">Future&lt;List&lt;ProductDetails>> getProductsByType(StoreItemType type) async {     final Set&lt;String> productsIds;      switch (type) {       case StoreItemType.coins:         productsIds = StoreProductsIds.coins;         break;       case StoreItemType.subscription:         productsIds = StoreProductsIds.subscriptions;         break;     }      final bool isAvailable = await _inAppPurchase.isAvailable();     if (!isAvailable) {       return [];     }      final ProductDetailsResponse productDetailResponse =         await _inAppPurchase.queryProductDetails(productsIds);      if (productDetailResponse.error != null ||         productDetailResponse.productDetails.isEmpty) {       return [];     }      return productDetailResponse.productDetails;   }<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432  \u0432 \u0442\u0430\u043a\u043e\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0435.<\/p>\n<pre><code class=\"dart\">class ProductDetails {   \/\/\/ Creates a new product details object with the provided details.   ProductDetails({     required this.id,     required this.title,     required this.description,     required this.price,     required this.rawPrice,     required this.currencyCode,     this.currencySymbol = '',   });    \/\/\/ The identifier of the product.   \/\/\/   \/\/\/ For example, on iOS it is specified in App Store Connect; on Android, it is specified in Google Play Console.   final String id;    \/\/\/ The title of the product.   \/\/\/   \/\/\/ For example, on iOS it is specified in App Store Connect; on Android, it is specified in Google Play Console.   final String title;    \/\/\/ The description of the product.   \/\/\/   \/\/\/ For example, on iOS it is specified in App Store Connect; on Android, it is specified in Google Play Console.   final String description;    \/\/\/ The price of the product, formatted with currency symbol (\"$0.99\").   \/\/\/   \/\/\/ For example, on iOS it is specified in App Store Connect; on Android, it is specified in Google Play Console.   final String price;    \/\/\/ The unformatted price of the product, specified in the App Store Connect or Sku in Google Play console based on the platform.   \/\/\/ The currency unit for this value can be found in the [currencyCode] property.   \/\/\/ The value always describes full units of the currency. (e.g. 2.45 in the case of $2.45)   final double rawPrice;    \/\/\/ The currency code for the price of the product.   \/\/\/ Based on the price specified in the App Store Connect or Sku in Google Play console based on the platform.   final String currencyCode;    \/\/\/ The currency symbol for the locale, e.g. $ for US locale.   \/\/\/   \/\/\/ When the currency symbol cannot be determined, the ISO 4217 currency code is returned.   final String currencySymbol; }<\/code><\/pre>\n<p>\u0422\u0430\u043a \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438,  \u043d\u043e \u043d\u0430\u0434\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u043a\u0430\u043a-\u0442\u043e \u0438\u0445 \u043a\u0443\u043f\u0438\u0442\u044c.<\/p>\n<p>\u0422\u0443\u0442 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u043a\u043b\u0430\u0441\u0441 \u043f\u0440\u043e\u0441\u043b\u043e\u0439\u043a\u0443 \u0434\u043b\u044f \u0445\u0435\u043d\u0434\u043b\u0438\u043d\u0433\u0430 \u0432\u0441\u0435\u0445 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0439 \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043c. \u0414\u0435\u043b\u043e \u0432\u043e\u0442 \u0432 \u0447\u0435\u043c \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 \u043e \u043f\u043e\u043a\u0443\u043f\u043a\u0435 \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u043f\u043e\u043a\u0443\u043f\u043a\u0443 \u043f\u043e\u0441\u043b\u0435. \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u043e\u0434\u043b\u0438\u043d\u043d\u043e\u0441\u0442\u0438 \u043f\u043b\u0430\u0442\u0435\u0436\u0430 \u043d\u0430 \u0431\u044d\u043a\u0435!  \u0415\u0441\u043b\u0438 \u043c\u044b \u043d\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043c \u043f\u043e\u043a\u0443\u043f\u043a\u0443 \u0434\u0435\u043d\u044c\u0433\u0438 \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043f\u043e\u043a\u0443\u043f\u0430\u0442\u0435\u043b\u044e \u0447\u0435\u0440\u0435\u0437 3 \u0434\u043d\u044f.  \u0418 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u0447\u0438\u0442\u0430\u0442\u044c\u0441\u044f \u043e\u0442\u043c\u0435\u043d\u0435\u043d\u043d\u043e\u0439. <\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043b\u0430\u0441\u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0445\u044d\u043d\u0434\u043b\u0438\u0442 \u0432\u0441\u0435 \u0441\u0442\u0435\u0439\u0442\u044b \u043f\u043b\u0430\u0442\u0435\u0436\u0435\u0439:<\/p>\n<pre><code class=\"dart\"> class PurchaseDetailsStreamSubscription {   final InAppPurchaseService inAppPurchaseService = Get.find&lt;InAppPurchaseService>();   final Function()? onPending;   final Function(PurchaseDetails purchaseDetails)? onPurchased;   final Function()? onError;   final Function()? onRestored;   final Function()? onCanceled;    StreamSubscription&lt;List&lt;PurchaseDetails>>? _streamSubscription;   PurchaseDetailsStreamSubscription({     this.onPending,     this.onPurchased,     this.onError,     this.onRestored,     this.onCanceled,   });    Future&lt;void> init() async {     _streamSubscription = inAppPurchaseService.getStoreSubscription().listen(       (List&lt;PurchaseDetails> events) {         Future.forEach(           events,           (PurchaseDetails purchaseDetails) async {             if (purchaseDetails.pendingCompletePurchase) {               await inAppPurchaseService.completePurchase(purchaseDetails);             }             switch (purchaseDetails.status) {               case PurchaseStatus.pending:                 onPending?.call();                 break;               case PurchaseStatus.purchased:                 onPurchased?.call(purchaseDetails);                 break;               case PurchaseStatus.error:                 onError?.call();                 break;               case PurchaseStatus.restored:                 onRestored?.call();                 break;               case PurchaseStatus.canceled:                 onCanceled?.call();                 break;             }           },         );       },     );   }    void close() {     _streamSubscription?.cancel();   } } <\/code><\/pre>\n<p> \u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0435\u0449\u0435 \u0434\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u0435 \u0434\u043b\u044f \u043f\u043e\u043a\u0443\u043f\u043e\u043a.<\/p>\n<pre><code class=\"dart\">Future&lt;bool> buyItemInStore(ProductDetails product) async {     final PurchaseParam purchaseParam = PurchaseParam(productDetails: product);     return InAppPurchase.instance.buyConsumable(purchaseParam: purchaseParam);   }    Future&lt;void> completePurchase(PurchaseDetails purchaseDetails) async {     await InAppPurchase.instance.completePurchase(purchaseDetails);   }<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u043a\u0430\u043a \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u043f\u043e\u043a\u0443\u043f\u043a\u0443 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b, \u0432\u0442\u043e\u0440\u043e\u0439 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u043f\u043e\u043a\u0443\u043f\u043a\u0443.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432 BloC \u0438\u043b\u0438 \u0433\u0434\u0435 \u0432\u0430\u043c \u0442\u0430\u043c \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0448 \u043a\u043b\u0430\u0441\u0441 \u043f\u0440\u043e\u0441\u043b\u043e\u0439\u043a\u0443 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0432 \u043d\u0435\u0433\u043e \u0442\u0430\u043a\u043e\u0435 <\/p>\n<pre><code class=\"dart\">purchaseDetailsStreamSubscription = PurchaseDetailsStreamSubscription(       onCanceled: closeLoader,       onError: closeLoader,       onPurchased: (PurchaseDetails purchaseDetails) async {         closeLoader();         try {           \/\/ \u0442\u0443\u0442 \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043d\u0430\u0448 \u043f\u043b\u0430\u0442\u0435\u0436 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0432 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043f\u043b\u0430\u0442\u0435\u0436\u0435 ,            \/\/ \u0438 \u0435\u0441\u043b\u0438 \u0432\u0441\u0435 \u043e\u043a \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u043c  \u043f\u043e\u043a\u0443\u043f\u043a\u0443           final bool res = await transactionRepository               .createTransaction(purchaseDetails.verificationData.serverVerificationData);           if (res) {             await inAppPurchaseService.completePurchase(purchaseDetails);             await updateBalance();           }         } catch (_, __) {}       },     )..init();<\/code><\/pre>\n<p>\u0412\u0441\u0435 \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u043f\u043e\u043a\u0443\u043f\u043a\u0443 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0437\u0432\u0430\u0432 \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434!<\/p>\n<pre><code class=\"dart\">inAppPurchaseService.buyItemInStore(item);<\/code><\/pre>\n<p>\u0421 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0430\u043c\u0438 \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u0442\u0430\u043a\u0430\u044f \u0436\u0435 \u0438\u0441\u0442\u043e\u0440\u0438\u044f, \u0430 \u0432\u043e\u0442 \u0441 \u043d\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u0443\u0435\u043c\u044b\u043c\u0438 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430\u043c \u043d\u0430\u0434\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 .<\/p>\n<pre><code>buyNonConsumable<\/code><\/pre>\n<p>\u041a\u0430\u043a-\u0442\u043e \u0442\u0430\u043a! \u0412\u0441\u0435\u043c \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435! <\/p>\n<\/p>\n<p>P.S. \u0435\u0441\u043b\u0438 \u0447\u0442\u043e \u043d\u0435 \u0442\u0430\u043a, \u043f\u043e\u043f\u0440\u0430\u0432\u044c\u0442\u0435 \u043f\u043b\u0438\u0437 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0445!) \u0441\u043f\u0430\u0441\u0438\u0431\u043e)<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/709400\/\"> https:\/\/habr.com\/ru\/post\/709400\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-343630","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/343630","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=343630"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/343630\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=343630"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=343630"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=343630"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}