<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Hajime Nakamura on Medium]]></title>
        <description><![CDATA[Stories by Hajime Nakamura on Medium]]></description>
        <link>https://medium.com/@hajimenakamura?source=rss-c704a6bc76ed------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*A-EPJCTWMyK4-GWTUUG6XA.jpeg</url>
            <title>Stories by Hajime Nakamura on Medium</title>
            <link>https://medium.com/@hajimenakamura?source=rss-c704a6bc76ed------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 11:52:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hajimenakamura/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Japanese input of TextField of SwiftUI does not working]]></title>
            <link>https://medium.com/@hajimenakamura/japanese-input-of-textfield-of-swiftui-does-not-working-70244684821d?source=rss-c704a6bc76ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/70244684821d</guid>
            <category><![CDATA[swiftui]]></category>
            <category><![CDATA[textfield]]></category>
            <category><![CDATA[bugs]]></category>
            <category><![CDATA[japanese]]></category>
            <dc:creator><![CDATA[Hajime Nakamura]]></dc:creator>
            <pubDate>Mon, 25 May 2020 13:24:33 GMT</pubDate>
            <atom:updated>2020-05-25T13:24:33.317Z</atom:updated>
            <content:encoded><![CDATA[<p>Xcode 11.5 was released the other day, but the problem of Japanese input of TextField has not been fixed. <br><br>It’s very disappointing to me.</p><p>For a while, I decided to use UITextField from UIViewRepresentable.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e91fcc76bfa635527aa9944f929d90ab/href">https://medium.com/media/e91fcc76bfa635527aa9944f929d90ab/href</a></iframe><p>May the bug be fixed. 🦾</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=70244684821d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Text link in flutter]]></title>
            <link>https://medium.com/@hajimenakamura/text-link-in-flutter-96619918cff7?source=rss-c704a6bc76ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/96619918cff7</guid>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Hajime Nakamura]]></dc:creator>
            <pubDate>Mon, 10 Sep 2018 01:16:47 GMT</pubDate>
            <atom:updated>2018-09-10T01:19:30.022Z</atom:updated>
            <content:encoded><![CDATA[<p>If you want to open url by web browser, You can use <a href="https://pub.dartlang.org/packages/url_launcher"><em>url_launcher</em></a> package.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/235e91081ec50fe4022d8374766c523b/href">https://medium.com/media/235e91081ec50fe4022d8374766c523b/href</a></iframe><p>And call <em>launch</em> method in <em>onTap</em> call back like bellow.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/51a0d0461f4332574a715b69e2119ed4/href">https://medium.com/media/51a0d0461f4332574a715b69e2119ed4/href</a></iframe><p>that’s all 🐼</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=96619918cff7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Modal transition in Flutter]]></title>
            <link>https://medium.com/shipkaro/modal-transition-in-flutter-4026601ce390?source=rss-c704a6bc76ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/4026601ce390</guid>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[dart]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Hajime Nakamura]]></dc:creator>
            <pubDate>Thu, 09 Aug 2018 10:28:00 GMT</pubDate>
            <atom:updated>2018-08-28T11:01:03.708Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello, This is small tips 🐼</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b5a6fe8abc42568100cba41016bb98e0/href">https://medium.com/media/b5a6fe8abc42568100cba41016bb98e0/href</a></iframe><p>You can also use <strong>CupertinoPageRoute</strong>. 🍎</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/345/1*MdqhGQ7pauqm3jlvcacJYw.gif" /><figcaption>Sample code <a href="https://github.com/nkmrh/flutter-modal-transition-sample/tree/master">here</a></figcaption></figure><p>The <a href="https://medium.com/flutterpub"><strong>Flutter Pub</strong></a> is a medium publication to bring you the latest and amazing resources such as articles, videos, codes, podcasts etc. about this great technology to teach you how to build beautiful apps with it. You can find us on <a href="https://www.facebook.com/FlutterPub">Facebook</a>, <a href="https://twitter.com/FlutterPub">Twitter</a>, and <a href="https://medium.com/flutterpub">Medium</a> or learn more about us <a href="https://medium.com/flutterpub/welcome-to-flutter-pub-8480678ed212">here</a>. We’d love to connect! And if you are a writer interested in writing for us, then you can do so <a href="https://medium.com/flutterpub/how-to-submit-your-article-s-on-flutterpub-7b6bf37dfc43">through these guidelines</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*kCSr9XbxNRLVG5TtTbIWiQ.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4026601ce390" width="1" height="1" alt=""><hr><p><a href="https://medium.com/shipkaro/modal-transition-in-flutter-4026601ce390">Modal transition in Flutter</a> was originally published in <a href="https://medium.com/shipkaro">shipkaro — my journey to $10k</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to disable firebase anonymous user account]]></title>
            <link>https://medium.com/@hajimenakamura/how-to-disable-firebase-anonymous-user-account-df5d0955c7a?source=rss-c704a6bc76ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/df5d0955c7a</guid>
            <category><![CDATA[firebase]]></category>
            <dc:creator><![CDATA[Hajime Nakamura]]></dc:creator>
            <pubDate>Fri, 29 Jun 2018 00:42:56 GMT</pubDate>
            <atom:updated>2018-06-29T00:51:31.612Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mP5YGRlfzyKQGm8SYafilQ.jpeg" /></figure><h3>Overview</h3><p>This article is a method to invalidate the account of a user who is using anonymous sign-in using Firebase Authentication. I was somewhat troubled when trying to suspend an account of a violating user so write it down.</p><p>I thought that it would be easy to do it clearly from the “disable account” menu in the Authentication console, but it was not possible for anonymous users. In the case of mail address authentication, I think that an error was returned at the time of authentication. This is because the <a href="https://firebase.google.com/docs/reference/swift/firebaseauth/api/reference/Classes/Auth?hl=ja#/c:objc(cs)FIRAuth(im)signInAnonymouslyWithCompletion:"><em>signInAnonymously ((completion :)) </em></a>method of the Auth class creates a new anonymous user and signs in. In other words, <strong>even if you do “Disable account” from the console, the target user can continue to use the application as a new anonymous user</strong>.</p><h3>Workaround</h3><p>The solution is simple. Prepare a collection <em>(e.g. bannedUser)</em> for the suspended account in the database, and create a document of the ID of the target user there. Next, add a condition on whether the requestor is included in the collection in the database rule. It becomes as follows. The database <a href="https://ejje.weblio.jp/content/says">r</a>ule <a href="https://ejje.weblio.jp/content/as">as</a> follows.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1eebda1fa6aaad5462fa48c0be08cffc/href">https://medium.com/media/1eebda1fa6aaad5462fa48c0be08cffc/href</a></iframe><p>The above rule can prevent comments from being written from the target user. The point is to use the <a href="https://firebase.google.com/docs/reference/rules/rules.firestore?hl=ja#.exists">exists</a> method of <em>rules.firestore</em>.</p><h3>Conclusion</h3><p>In addition to the above methods, for example, it is possible to have a property like isBanned in the User object and control it on the application side, but in that case, more things must be taken into consideration and the implementation of the application I think that it becomes complicated.</p><p>There was an announcement of the <a href="https://firebase.googleblog.com/2018/06/announcing-firestore-security-rules.html"><em>Rules Simulator</em></a> recently. With this you can check the operation without deploying. I hope that the function of the console will be expanded in the future. 😃</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df5d0955c7a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Talk about trying to detect inappropriate images with Firebase ML Kit]]></title>
            <link>https://medium.com/@hajimenakamura/talk-about-trying-to-detect-inappropriate-images-with-firebase-ml-kit-3d5893d175fc?source=rss-c704a6bc76ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d5893d175fc</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[swif]]></category>
            <dc:creator><![CDATA[Hajime Nakamura]]></dc:creator>
            <pubDate>Fri, 15 Jun 2018 00:45:03 GMT</pubDate>
            <atom:updated>2018-06-15T00:48:50.237Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PlXWYqefzREkvBCfZ_0hhQ.jpeg" /></figure><p>Although it became a little late, I tried touching the Firebase ML Kit published at Google I/O 2018 because it seemed interesting. This time I tried to detect inappropriate images. In conclusion, I could not do it, but I would like to keep it as memorandum.</p><h3>What is Firebase ML Kit?</h3><p>Firebase ML Kit can easily bring Google machine learning expertise to Android and iOS applications. At present, mainly image recognition function is provided.</p><h3>Functions</h3><p>The following functions are available</p><ul><li>Text recognition</li><li>Face detection</li><li>Barcode scan</li><li>Labeling</li><li>Landmark recognition</li></ul><p>In addition to this, it was the best to have “inappropriate image detection”, but since it is not there, I tried using “labeling” function.</p><h3>Approaches</h3><p>The way to recognize images is by using a model on the device and using a model in Google’s server, the advantages of each are as follows.</p><h4>On device</h4><ul><li>Free</li><li>400+ labels</li><li>Knowledge Graph entity ID support</li></ul><h4>Cloud</h4><ul><li>Free for first 1000 uses</li><li>10,000+ labels</li><li>Knowledge Graph entity ID support</li></ul><p>I think the Knowledge Graph entity ID is the entity ID used in <a href="https://developers.google.com/knowledge-graph/">Google Knowledge Graph Search API</a>.</p><h3>Let’s do it!</h3><p>This time, I tried a method to use a model on the device for free reasons.</p><p>When preparing the <a href="https://pixabay.com/p-949916/?no_redirect">zombie image</a> and implementing it according to the documentation, the following label was obtained.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/269a5b94b8f1ef483873300cb1717b1f/href">https://medium.com/media/269a5b94b8f1ef483873300cb1717b1f/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/456c729d7f10cddb43c0b804d6def077/href">https://medium.com/media/456c729d7f10cddb43c0b804d6def077/href</a></iframe><h3><strong>Conclusion</strong></h3><p>It is difficult to judge it as inappropriate image from the label obtained from VisionLabelDetector, but using Google Cloud Vision API seems to be able to realize what I wanted to do this time. There was a tutorial <a href="https://cloud.google.com/functions/docs/tutorials/imagemagick?hl=en">here</a>. <br>I hope to be able to do with ML Kit in the future as well!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d5893d175fc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[FCM with curl]]></title>
            <link>https://medium.com/@hajimenakamura/fcm-with-curl-49be7d4bfcbb?source=rss-c704a6bc76ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/49be7d4bfcbb</guid>
            <category><![CDATA[firebasecloudmessaging]]></category>
            <dc:creator><![CDATA[Hajime Nakamura]]></dc:creator>
            <pubDate>Mon, 05 Mar 2018 00:50:44 GMT</pubDate>
            <atom:updated>2018-03-05T00:53:20.407Z</atom:updated>
            <content:encoded><![CDATA[<iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eb51a6745e808d1acc597c1d116fd609/href">https://medium.com/media/eb51a6745e808d1acc597c1d116fd609/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=49be7d4bfcbb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The passed torchLevel 0.000000 is invalid]]></title>
            <link>https://medium.com/@hajimenakamura/the-passed-torchlevel-0-000000-is-invalid-b98499b11d5a?source=rss-c704a6bc76ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/b98499b11d5a</guid>
            <category><![CDATA[ios-app-development]]></category>
            <dc:creator><![CDATA[Hajime Nakamura]]></dc:creator>
            <pubDate>Wed, 28 Feb 2018 07:07:49 GMT</pubDate>
            <atom:updated>2018-02-28T07:07:49.856Z</atom:updated>
            <content:encoded><![CDATA[<p>I encounterd an error below when I try to use torch.</p><pre>*** Terminating app due to uncaught exception &#39;NSInvalidArgumentException&#39;, reason: &#39;*** -[AVCaptureDevice setTorchModeOnWithLevel:error:] The passed torchLevel 0.000000 is invalid&#39;</pre><p><a href="https://developer.apple.com/documentation/avfoundation/avcapturedevice/1387674-hastorch#">The description of this method’s document</a> is as fllows.</p><pre>The new torch mode level. This value must be a floating-point number between 0.0 and 1.0. To set the torch mode level to the currently available maximum, specify the constant AVCaptureMaxAvailableTorchLevel for this parameter.</pre><p>Therefore, I took a workaround.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3ca996f21204d758689e8cdecf523f23/href">https://medium.com/media/3ca996f21204d758689e8cdecf523f23/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b98499b11d5a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[firestore cloud functions onCreate/onDelete sometimes immediately triggered twice]]></title>
            <link>https://medium.com/@hajimenakamura/firestore-cloud-functions-oncreate-ondelete-sometimes-immediately-triggered-twice-5ecf7eaa9fb2?source=rss-c704a6bc76ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/5ecf7eaa9fb2</guid>
            <category><![CDATA[cloud-firestore]]></category>
            <category><![CDATA[firebase-cloud-functions]]></category>
            <category><![CDATA[firebase]]></category>
            <dc:creator><![CDATA[Hajime Nakamura]]></dc:creator>
            <pubDate>Fri, 23 Feb 2018 05:53:55 GMT</pubDate>
            <atom:updated>2018-06-12T00:50:17.721Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5FG0eXjAcattm04UtVMzSQ.jpeg" /></figure><p>I encounterd a problem with my firebase cloud function which is sometimes immediately triggered twice when used with firestore in combination.</p><p>There seems to be someone with the same problem on <a href="https://stackoverflow.com/questions/48735862/firestore-cloud-functions-oncreate-ondelete-sometimes-immediately-triggered-twic">stack overflow</a>.</p><p>As mentioned in the document <a href="https://firebase.google.com/docs/functions/firestore-events#limitations_and_guarantees">Limitations and Guarantees section</a>, there seems to be the possibility of multiple invocations for a single event.</p><p>In my case, I’m using a firebase cloud function to send a push notification when a post is posted, but due to this problem, it is frequent that two notifications are sent with one post.</p><p>Since it was written that it is necessary to write the function to idempotence in the document, I saved the event ID in the global variable and added a code to ignore the event which triggered already.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/94a9fa93143e1a3ba684422b6083f8a0/href">https://medium.com/media/94a9fa93143e1a3ba684422b6083f8a0/href</a></iframe><p>I’m watching how this works.</p><p>Please get in touch if you know how to solve this problem!</p><p>At a developers’ conference (Try! Swift Tokyo 2018) I asked a member of the Firebase team about best practices for sending push notifications using Firebase cloud function.</p><p>He said that they hadn’t established a best practice yet, and promised to e-mail me when they found a solution.</p><p>He also said that my implementation will not be able to resolve the problem, because a global variable is created for each Firebase cloud function.</p><p>In fact, my implementation only resolved the problem some of the time.</p><p>I think it was only successful when a function was implemented on the same instance by chance.</p><p>I also asked about an implementation using Firestore transactions, He said that transactions sometimes retry tasks in a transaction, and in such cases will not be able to resolve the problem.</p><p><strong>Additional notes</strong></p><p>When the function is triggered, it seems to work fine by saving the event ID in the firestore and checking it. Here is the code.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2b0211da642cac681dc0aaac7cb5bce8/href">https://medium.com/media/2b0211da642cac681dc0aaac7cb5bce8/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ecf7eaa9fb2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Firebase anonymous token never expire]]></title>
            <link>https://medium.com/@hajimenakamura/firebase-anonymous-token-never-expire-38c121609ca7?source=rss-c704a6bc76ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/38c121609ca7</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[firebase]]></category>
            <dc:creator><![CDATA[Hajime Nakamura]]></dc:creator>
            <pubDate>Tue, 20 Feb 2018 02:07:57 GMT</pubDate>
            <atom:updated>2018-02-20T02:07:57.876Z</atom:updated>
            <content:encoded><![CDATA[<p>I’m using firebase’s anonymous login for about 2 months. One day, I was worried that when the anonymous token expired, the user noticed that my ios app could not be used as usual.</p><p>However, when I searched about it, I could not find the answer in the official document, but I was relieved that Google engineers explained that the anonymous token never expire.</p><p><a href="https://stackoverflow.com/questions/41733137/firebase-auth-anonymous-login#comment70661655_41733137">https://stackoverflow.com/questions/41733137/firebase-auth-anonymous-login#comment70661655_41733137</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=38c121609ca7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>