<?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 Durga Vundavalli on Medium]]></title>
        <description><![CDATA[Stories by Durga Vundavalli on Medium]]></description>
        <link>https://medium.com/@durgavundavalli?source=rss-880adad257a0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Ss2t1veSklA9yhNdNtaKWQ.jpeg</url>
            <title>Stories by Durga Vundavalli on Medium</title>
            <link>https://medium.com/@durgavundavalli?source=rss-880adad257a0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 00:08:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@durgavundavalli/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[iOS silent/background push notifications]]></title>
            <link>https://medium.com/@durgavundavalli/ios-silent-background-push-notifications-5bbadc5606cd?source=rss-880adad257a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/5bbadc5606cd</guid>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[silent-push-notification]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[push-notification]]></category>
            <dc:creator><![CDATA[Durga Vundavalli]]></dc:creator>
            <pubDate>Tue, 06 Feb 2024 20:22:06 GMT</pubDate>
            <atom:updated>2024-02-07T10:31:42.363Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zOBBVwvZ31FLns_QfaE_AA.png" /></figure><p>Silent or background push notifications are notifications sent remotely to your app that don’t show alerts, play sounds, or add badges to your app icon.</p><p>Instead, they wake up your app in the background, giving it time to perform certain actions.</p><p>To enable your app to receive background notifications, you need to add the Remote Notifications background mode in your app’s capabilities. In the Signing and Capabilities tab of your project settings, add the Background Modes capability, then select Remote Notifications.</p><p>To send background notifications, create a remote notification payload with apskey containing only the content-available key. This key indicates that the notification is silent and doesn’t require any user interaction.</p><p>Example payload:</p><pre>{<br>    &quot;aps&quot; : {<br>        &quot;content-available&quot; : 1<br>    },<br>     &quot;data&quot; :{<br>        &quot;title&quot; : &quot;custom data&quot;,<br>        &quot;body&quot; : &quot;custom data&quot;<br>     }<br>}</pre><p>Unlike regular push notifications, it doesn’t prompt any user interaction but silently delivers payload, allows the app to take necessary action in the background.</p><p>Silent notifications are not intended to keep your app awake in the background for extended periods or for delivering high priority updates.</p><p>They should not be used beyond some quick refresh operations.</p><p>Why they are not meant for high priority updates:</p><ul><li>Background notifications are treated as low priority by the system.</li><li>You can use them to refresh your app’s content, but the system doesn’t guarantee their delivery and the system may throttle them if there are too many.</li><li>The number of background notifications allowed by the system depends on current conditions(like battery and other high priority items). Try limit to as less notifications as possible(2/hour).</li></ul><p>Receive Background Notifications:</p><ul><li>When the system receives a new background notification, it discards the older notification and only holds the newest one.</li><li>If the system force quits or kills the app, the system discards the held notification.</li><li>If the user launches the app, the system immediately delivers the held notification.</li></ul><p>Notifications rate limit:</p><ul><li>We have no control over the rate limit (the number of notifications that can be sent).</li><li>The more you launch your app for refreshing the content, the system becomes less willing to initiate its launch.</li><li>Observation: It’s important to note that even with background notification enabled, the system won’t automatically launch your app into the background if the user has force-quit it. The user must explicitly launch the app or reboot the device for background notifications to work.</li></ul><p><strong>References:</strong></p><ul><li><a href="https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/pushing_background_updates_to_your_app">https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/pushing_background_updates_to_your_app</a></li><li><a href="https://www.braze.com/docs/developer_guide/platform_integration_guides/ios/push_notifications/silent_push_notifications/">https://www.braze.com/docs/developer_guide/platform_integration_guides/ios/push_notifications/silent_push_notifications/</a></li><li><a href="https://developer.apple.com/forums/thread/47901">https://developer.apple.com/forums/thread/47901</a></li><li><a href="https://stackoverflow.com/questions/53531369/limits-on-silent-push-notifications-per-hour">https://stackoverflow.com/questions/53531369/limits-on-silent-push-notifications-per-hour</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5bbadc5606cd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mobile Application Security: Storage]]></title>
            <link>https://medium.com/@durgavundavalli/mobile-application-security-storage-6763459c4f5e?source=rss-880adad257a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/6763459c4f5e</guid>
            <category><![CDATA[owasp-top-10]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Durga Vundavalli]]></dc:creator>
            <pubDate>Mon, 05 Feb 2024 03:42:54 GMT</pubDate>
            <atom:updated>2024-02-05T03:42:54.230Z</atom:updated>
            <content:encoded><![CDATA[<h4>Local Storage of Sensitive Data:</h4><p>Mobile apps manage diverse sensitive information, including personally identifiable information (PII), secrets (passwords, credit card details), certificates and identities (API keys). This crucial data is typically stored locally in private locations, such as the app’s internal storage and keychain, accessible to the user.</p><p>As a developer, it’s crucial to guarantee the safety and security of any sensitive data stored within the app.</p><ul><li>Never store sensitive data without appropriate protection.</li><li>Avoid storing encryption keys in .plist files</li><li>Avoid hardcoding keys as strings in code.</li></ul><p>Use Keychain API to store the sensitive data inside a secure enclave. Configure data protection for Keychain items by setting the kSecAttrAccessible according to the security required, this ensures the usage of hardware-backed storage mechanisms.</p><blockquote>Remember, the Keychain isn’t intended for storing larger chunks of data.</blockquote><p>Ensure the protection of sensitive data stored in Database/NSUserDefaults/cache by employing suitable encryption techniques.</p><p>The following algorithms are recommended:</p><ul><li>Confidentiality algorithms: AES-GCM-256 or ChaCha20-Poly1305</li><li>Integrity/Hashing algorithms: SHA-256, SHA-384, SHA-512, BLAKE3, the SHA-3 family</li><li>Digital signature algorithms(Asymmetric/Symmetric): RSA (3072 bits and higher), ECDSA with NIST P-384, AES 128/256 bits</li></ul><p>Algorithms that are unsafe/compromised/weak:</p><ul><li>DES, 3DES, BLOWFISH (encryption algorithms)</li><li>RC2, RC4 (stream ciphers)</li><li>MD4, MD5, SHA1 (hashing)</li></ul><p><strong>Check for Unintentional Sensitive Data sharing in:</strong></p><ul><li>Device Logs:</li><li>Shared to Third Parties</li><li>Cache</li><li>Device Backups</li></ul><p><strong>Device Logs:</strong></p><p>Use the following keywords to check the app’s source code for predefined/custom log statements:</p><ul><li>NSLog</li><li>NSAssert</li><li>NSCAssert</li><li>fprintf</li></ul><p>A generalised approach to this issue is to use define(#ifdef) to enable NSLog statements for development and debugging, then disable them before deploying them to production.</p><p><strong>Shared to Third Parties:</strong></p><p>To prevent the exposure of Personal Identifiable Information (PII) and maintain user anonymity, it’s crucial to anonymise all data sent to third-party services.</p><p>Avoid transmitting any data, including IDs that could be linked to a user account or session. Despite the challenge of developers often lacking insight into the code executed by third-party libraries, it’s essential to thoroughly review them.</p><p>Regularly inspect requests to external services to ensure the secure transmission of data. For dynamic analysis, consider using interception tools like Burp Suite Professional or OWASP ZAP to perform a man-in-the-middle (MITM) attack. By routing traffic through an interception proxy, you can scrutinise the communication between the app and server, checking for any sensitive information.</p><p>Verify the app requests, especially those not directly sent to the main function’s hosting server, are free from PII or other confidential data, such as in trackers or ad services.</p><p><strong>Cache:</strong></p><p>Ensure the application avoids caching sensitive information entered into input text fields. Disable caching programmatically by using the textObject.autocorrectionType = UITextAutocorrectionTypeNo directive in the relevant UITextFields, UITextViews, and UISearchBars.</p><p>For masked data like PINs and passwords, set textObject.secureTextEntry to YES.</p><p>To confirm this, inspect the xib and storyboard files in Xcode’s Interface Builder, checking the states of Secure Text Entry and Correction in the Attributes Inspector for the respective objects.</p><p><strong>Device Backups:</strong></p><p>A device backup on which a mobile application has been installed includes all subdirectories (excluding Library/Caches/) and files in the app’s private directory.</p><p>To maintain security, avoid storing sensitive data in plaintext within any files or folders in the app’s private directory or subdirectories.</p><p>While all files in Documents/ and Library/Application Support/are automatically backed up, you can selectively exclude files from the backup by using NSURL setResourceValue:forKey:error: with the NSURLIsExcludedFromBackupKey key.</p><p>If an app needs to exclude multiple files, it can create its own subdirectory and designate it as excluded. Apps should create their own exclusion directories instead of excluding system-defined ones.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6763459c4f5e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Experience with Ionic Cordova]]></title>
            <link>https://medium.com/@durgavundavalli/experience-with-ionic-cordova-8f6068160268?source=rss-880adad257a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f6068160268</guid>
            <category><![CDATA[cross-platform]]></category>
            <category><![CDATA[ionic-framework]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[cordova]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Durga Vundavalli]]></dc:creator>
            <pubDate>Sat, 23 May 2020 20:19:55 GMT</pubDate>
            <atom:updated>2020-05-23T20:19:55.770Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*GfGw8LjhbGsONhj7HfrUKA.jpeg" /><figcaption>Cordova</figcaption></figure><p>Cordova allows cross-platform frameworks like Ionic to integrate the device native features like Camera, Location, Push etc.. into the app. On working with Cordova for some-time now, I have observed/faced the following challenges:</p><blockquote>Note: I have not used the Enterprise plan offered by Ionic</blockquote><p>Let&#39;s start with the native features that we require in our project:</p><ul><li>Barcode/QR code scanner</li><li>Geo Location (Current Location, Routing, Location Tracking)</li><li>Push Notifications</li><li>VOIP Notifications</li><li>Deep-linking</li></ul><p><strong>Cordova Plugins Support for the above features:</strong></p><ul><li>Almost all the Cordova plugins offer you a basic set of features, customizing them is a challenge as most of the plugins use a very old version of native libraries or Cocopods. If you plan to upgrade it, you end up writing your own.</li><li>Most of the plugins are outdated (at least with a free plan).</li><li>Let’s consider an Ionic Push plugin available in official Ionic docs (<a href="https://ionicframework.com/docs/native/push">https://ionicframework.com/docs/native/push</a>). This plugin uses a very old version (2.0.0) of the firebase. The current version of the firebase is 6.23.0.</li><li><a href="https://github.com/phonegap/phonegap-plugin-push">phonegap-plugin-push</a> plugin supports VoIP notifications but doesn’t have any implementation for CallKit. Apple has made this mandatory from iOS13. For more details on VoIP notification in iOS 13 please refer to the following <a href="https://medium.com/@durgavundavalli/ios-13-voip-notifications-d653890dd9ac">link</a></li><li>To support VOIP based calls, we ended up customizing the plugin with all the necessary CallKit Implementations.</li><li>Barcode Scanner Plugin (<a href="https://ionicframework.com/docs/native/barcode-scanner">https://ionicframework.com/docs/native/barcode-scanner</a>) doesn’t meet our requirements. It doesn&#39;t scan multiple barcodes or QR codes.</li><li>The geolocation plugin that we have tested is only supporting location tracking. To support routing, I think we should build our plugin or look for another plugin</li></ul><p>As we ended up writing custom plugins for almost all the native features the team must know about both iOS(Swift and Objective C) and Android(Java or Kotlin).</p><p>In our case, for now, we ended-up writing plugins for:</p><ul><li><strong>Barcode scanner plugin</strong> — supports scanning different types of codes (Bar, QR) at the same time.</li><li><strong>Push, VOIP</strong> — We have created a custom plugin for PushKit and CallKit, we can customize the same plugin in the future to support deep-linking as well.</li><li><strong>GeoLocation</strong> plugin supports only a simple location tracking feature. If we need more features like routing, we have to create a custom plugin.</li></ul><p><strong>Documentation Support:</strong></p><p>Official documents are not updated based on the Ionic version released so, we end-up with compatibility/environmental issues.</p><ul><li>When we started creating our plugins the documentation that is provided on the Cordova official site for creating a simple plugin is not at all encouraging.</li><li>We had a tough time communicating between native to ionic and vice-versa.</li><li>We have solved many of our problems by going through the open-source code of already created plugins</li><li>We always end up solving some environmental problems instead of concentrating on the actual problem. One example I have explained here:(<a href="https://medium.com/@durgavundavalli/nscamerausagedescription-value-missing-in-cordova-ec72fec2efcf">https://medium.com/@durgavundavalli/nscamerausagedescription-value-missing-in-cordova-ec72fec2efcf</a>).</li><li>Debugging communication between Ionic and native features is challenging. Debugger disconnects automatically when we use safari -&gt; Develop -&gt; Device.</li><li>Generic error messages like “Failed to load webpage with error: Could not connect to the server.” Show up and you never know the actual reason for it. Sometimes clean and run would work.</li></ul><p><strong>Libraries Support:</strong></p><ul><li>The external SDK providers like Zoom video call, which we are using in our app is not providing cross-platform plugins for Cordova.</li><li>Maybe this is because WKWebView doesn’t support WebRTC calls( as of now) and Ionic wraps the app in a WebView.</li></ul><p><strong>Market:</strong></p><ul><li>Based on AppBrain statistics (<a href="https://www.appbrain.com/stats/libraries/details/phonegap/phonegap-apache-cordova">https://www.appbrain.com/stats/libraries/details/phonegap/phonegap-apache-cordova</a>), <strong>Cordova</strong> takes up 6.34% apps and 1.09% installs of the entire <strong>market</strong> and around 1.20% of the top-500 U.S. apps and installs.</li><li>Apache Cordova has a market share of about 0.1% (<a href="https://enlyft.com/tech/products/apache-cordova)">https://enlyft.com/tech/products/apache-cordova)</a></li></ul><p>Going further maintenance of these plugins will also be challenging with a lack of resources with all these skills (Ionic, Angular, Native — iOS and Android).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f6068160268" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[iOS 13 VoIP Notifications]]></title>
            <link>https://medium.com/@durgavundavalli/ios-13-voip-notifications-d653890dd9ac?source=rss-880adad257a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/d653890dd9ac</guid>
            <category><![CDATA[ios-13]]></category>
            <category><![CDATA[voip]]></category>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[Durga Vundavalli]]></dc:creator>
            <pubDate>Sat, 23 May 2020 18:59:58 GMT</pubDate>
            <atom:updated>2022-12-02T10:15:46.709Z</atom:updated>
            <content:encoded><![CDATA[<h3>iOS VoIP Notifications</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*9RwOkl51h7ah3XZiH7wlIg.jpeg" /></figure><p>With iOS 13 Apple now mandates that the VoIP notifications must be reported to CallKit framework. If your app repeatedly fails to report the VoIP notifications to CallKit, the system may stop delivering VoIP notifications to your app.</p><p>While configuring the VoIP push notifications, configure your requests with the following:</p><ul><li>Include the necessary call details in the JSON payload, this will enable us to report VoIP notifications to CallKit within the time frame. Apple allows a VoIP payload size of about 5KB.</li><li>Setting the apns-expiration to “0” will let the APNS know that the notification has to be delivered immediately.</li></ul><p><strong>Handling Incoming VoIP:</strong></p><p>pushRegistry(_:didReceiveIncomingPushWith:for:completion:) method will be triggered on receiving a VoIP notification to your app. You can use this method to report the incoming call to CallKit.</p><p>CXProvider object is used to report an incoming VoIP notification. Create a CXProvider object globally using a CXProviderConfigurationas follows:</p><pre>//create CXProvider object<br>let config = CXProviderConfiguration(localizedName: &quot;My App&quot;)<br>config.iconTemplateImageData = UIImagePNGRepresentation(UIImage(named: &quot;yourImage&quot;)!)<br>config.ringtoneSound = &quot;ringtone.caf&quot;<br>config.includesCallsInRecents = false;<br>config.supportsVideo = true;</pre><pre>let callProvider = CXProvider(configuration: config)</pre><p>Handle the incoming event using the following method:</p><pre>//On receiving a VoIP notification</pre><pre>func pushRegistry(_ registry: PKPushRegistry,didReceiveIncomingPushWith payload: PKPushPayload for type: PKPushType, completion: @escaping () -&gt; Void) {</pre><pre>if type == .voIP {<br>//Get the required data from the notification payload<br>if let handle = payload.dictionaryPayload[“handle”] as? String,<br>let uuidString = payload.dictionaryPayload[“callUUID”] as? String,let callUUID = UUID(uuidString: uuidString) {</pre><pre>// Configure the call information<br>let callUpdate = CXCallUpdate()<br>let phoneNumber = CXHandle(type: .phoneNumber, value: handle)<br>callUpdate.remoteHandle = phoneNumber</pre><pre>// Report the call to CallKit<br>callProvider?.reportNewIncomingCall(with: callUUID, update: callUpdate, completion: { (error) in</pre><pre>// Tell PushKit that the notification is handled.<br>completion()<br>})<br>}}}</pre><p>Extract the call data from the notification’s payload and create a CXCallUpdate object and pass it to the reportNewIncomingCall(with:update:completion:) method.</p><p><strong>Call Interface handling:</strong></p><p>Use the CXProviderDelegate methods to handle the call UI actions</p><pre>func provider(_ provider: CXProvider, perform action: CXAnswerCallAction) {<br>        action.fulfill()<br> }<br><br>func provider(_ provider: CXProvider, perform action: CXEndCallAction) {<br>        action.fulfill()<br> }</pre><p>It is important to <strong>fulfill</strong> or <strong>fail</strong> the action based on the user status.</p><p>If a call has failed, report it with a reason, using reportCall(with:endedAt:reason:) method. Refer to CXCallEndedReason enum for all the reasons to end the call.</p><pre>self.callProvider.reportCall(with: callUUID, endedAt: Date(), reason: .remoteEnded)</pre><p>If you don’t report the actions to CallKit repeatedly, the app will stop receiving VoIP notifications.</p><p><strong>Tip:</strong> After receiving the VoIP notification, you could directly communicate with the app over the network using API calls or using a socket mechanism to let the server know about the status of the user(like Busy/Hangup etc..). It’s up to your project requirement on which mechanism to use.</p><p><strong>Call Hang-Ups and Failures:</strong></p><p>Let us assume that we have a Caller and Receiver to discuss some general scenarios of calls</p><pre>self.callProvider.reportCall(with: callUUID, endedAt: Date(), reason: .remoteEnded)</pre><ul><li>If a caller hangs up the call, let the receiver know about this using the network connection. Report this event to CallKit, using CXCallEndedReason.remoteEnded as the reason for the end of the call then if the incoming call interface is onscreen, Callkit updates the call interface to reflect the call dismissal.</li><li>If the receiver answers the call before the app establishes a connection to your server, don’t fulfill the action in your delegate method. Instead, wait until you establish a connection and then fulfill the action. At this time, the incoming call interface lets the user know that the call is connecting…</li><li>If the app fails to establish a connection to your server, call the reportCall method with the CXCallEndedReason.failed. If the incoming call interface is currently onscreen, the system updates it to indicate a failed call.</li></ul><p><strong>Tip:</strong> I got this from Stackoverflow answers</p><p>If your app stops receiving VoIP notifications during development you can try the following:</p><ul><li>Try to uninstall and install the application</li><li>Delete the derived data</li><li>Close the Xcode and open</li><li>Put your device to flight mode and try with only WiFi.</li><li>If none of the above works try with different certificates or try on the next day.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d653890dd9ac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ionic5: Cordova Custom Plugin for Objective C]]></title>
            <link>https://medium.com/@durgavundavalli/ionic5-cordova-custom-plugin-for-objective-c-e4e82c5fbc3b?source=rss-880adad257a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/e4e82c5fbc3b</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[cordova]]></category>
            <category><![CDATA[objective-c]]></category>
            <category><![CDATA[ionic-5]]></category>
            <category><![CDATA[cordova-plugin]]></category>
            <dc:creator><![CDATA[Durga Vundavalli]]></dc:creator>
            <pubDate>Wed, 15 Apr 2020 18:52:29 GMT</pubDate>
            <atom:updated>2020-04-15T18:52:29.151Z</atom:updated>
            <content:encoded><![CDATA[<p>We can quickly create a basic plugin structure using the Plugman tool. This tutorial will give you a step by step procedure to create a custom plugin in Cordova.</p><p>To install Plugman you need to have node installed in your system. You can download the node from <a href="https://nodejs.org/en/download/">here</a>.</p><p>Install Plugman globally using the following command so that it is available from any directory</p><pre>npm install -g plugman</pre><p>Once you have installed Plugman you can create a plugin in your respective location, I will be creating a PluginDemo directory on my Desktop. Use the following commands in your terminal</p><pre>$ cd Desktop/<br>$ plugman create --name &lt;pluginName&gt; --plugin_id &lt;pluginId&gt; --        plugin_version 1.0.0</pre><p>Replace &lt;pluginName&gt;, &lt;pluginId&gt; with your names. For reference:</p><pre>plugman create --name PluginDemo --plugin_id cordova-plugin-plugindemo --plugin_version 1.0.0</pre><p>To add the platform you need to be in the PluginDemo folder you just created. Add the required platform to your plugin, in our case it is ios</p><pre>$ cd PluginDemo/<br>$ plugman platform add --platform_name ios // Android</pre><p>For npm, create a package.json file using the following command:</p><pre>plugman createpackagejson .</pre><p>Upon entering the above command, the terminal will ask you for some details. Enter the required details if you would like to modify or just keep pressing enter key the default once will be considered. Here is my screenshot for reference.</p><figure><img alt="Ionic 5 Cordova custom plugin for Objective C" src="https://cdn-images-1.medium.com/max/60/0*6OZunQQZFCjE1jRv" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BwE5IZguoed9dy3Y.png" /></figure><p>By following the above steps you have now created a basic plugin structure with the necessary platforms. Open PluginDemo in your IDE and look for the following folder structure. In our case, as we have added only ios platform <strong>src</strong> folder will contain only ios and default objective C class.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/60/0*IcihEJOQn9xV_LzA" /></figure><figure><img alt="Ionic5: Cordova Custom Plugin for Objective C" src="https://cdn-images-1.medium.com/max/636/0*UCviz6kE63jo7wsl.png" /></figure><p><strong>www</strong> folder will have a common interface that exposes the native methods to your Javascript framework.</p><p><strong>PluginDemo.js:</strong> exec(success, error, ‘PluginDemo’, ‘coolMethod’, [arg0]);</p><p>exec(&lt;successFunction&gt;, &lt;failFunction&gt;, &lt;service_name&gt;, &lt;action&gt;, [&lt;args&gt;]);</p><p>This will marshal a request from the UIWebView to the iOS native side, more or less boiling down to calling the action method on the service class, with the arguments passed in the args Array.</p><p>JavaScript exec call service_name and the name of the Objective-C class of the plugin should match.</p><p>JavaScript exec call action and the name of the Objective-C method of the plugin should match.</p><p>Without this added, the plugin may compile but will not be reachable by Cordova.</p><p><strong>PluginDemo.m</strong> is a basic class extended from CDVPlugin.</p><p>“<em>coolMethod</em>” method that returns the result based on the arg passed to it. Creates CDVPluginResult success/error and returns it with self.commandDelegate. Arguments passed are read from CDVInvokedUrlCommand context</p><pre>NSString* echo = [command.arguments objectAtIndex:0];if (echo != nil &amp;&amp; [echo length] &gt; 0) {pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:echo];} else {<br>pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR];<br>}<br>[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];</pre><p><strong>plugin.xml</strong> is where we configure all our iOS related information like source files, resource files, frameworks, assets, permissions(like camera, microphone), etc we will see how to configure all these in the coming tutorials.</p><p>For ease of accessing the plugin change the &lt;clobbers&gt; tag as the following in plugin.xml</p><pre>&lt;js-module name=”PluginDemo” src=”www/PluginDemo.js”&gt;<br>   &lt;clobbers target=”PluginDemo” /&gt; //to your plugin name<br>&lt;/js-module&gt;</pre><p>We can add a plugin to our project in different ways. I choose to make it available on GitHub at <a href="https://github.com/durga0303/PluginDemo">https://github.com/durga0303/PluginDemo</a> and add.</p><p>As the plugin code is made available public we can install this in our application with the following command</p><pre>$ cordova plugin add <a href="https://github.com/durga0303/PluginDemo.git">https://github.com/durga0303/PluginDemo.git</a></pre><p>We can access the native methods defined in the plugin with a simple service class but with this approach, I have faced some issues in Ionic 5.</p><p>To avoid those issues with Ionic 5, We will be creating a wrapper for our plugin and access it in our application.</p><p>Wrapper creation with ionic-native is <a href="https://medium.com/@durgavundavalli/cordova-create-a-native-wrapper-with-ionic-native-d88fbc6742a2">here</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e4e82c5fbc3b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NSCamerausagedescription value missing in Cordova]]></title>
            <link>https://medium.com/@durgavundavalli/nscamerausagedescription-value-missing-in-cordova-ec72fec2efcf?source=rss-880adad257a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec72fec2efcf</guid>
            <category><![CDATA[cordova]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[cordova-plugin]]></category>
            <dc:creator><![CDATA[Durga Vundavalli]]></dc:creator>
            <pubDate>Mon, 13 Apr 2020 21:11:56 GMT</pubDate>
            <atom:updated>2020-04-20T07:23:31.738Z</atom:updated>
            <content:encoded><![CDATA[<p>Adding the following &lt;edit-config&gt;in your plugin.xml should be more than enough to add the required usage descriptions to your Xcode info.plist file</p><pre>&lt;edit-config file=”*-Info.plist” mode=”merge” target=”NSCameraUsageDescription”&gt;<br> &lt;string&gt;need camera access to take pictures&lt;/string&gt;<br> &lt;/edit-config&gt;<br> &lt;edit-config file=”*-Info.plist” mode=”merge” target=”NSMicrophoneUsageDescription”&gt;<br> &lt;string&gt;need microphone access to record sounds&lt;/string&gt;<br> &lt;/edit-config&gt;</pre><p>“Remove” and “Add” ios platform again:</p><pre>ionic cordova platform remove ios<br>ionic cordova platform add ios</pre><p>If you are facing any issues with above as only the keys get added to info.plist and value is empty. Please look into any extra spaces added to your tags. I know this sounds a little odd but that is what happened to me.</p><pre>&lt;edit-config file=”*-Info.plist” mode=”merge” target=”NSLocationWhenInUseUsageDescription”&gt;<br>&lt;string&gt;need location access to find things nearby&lt;/string&gt;<br>&lt;/edit-config&gt;</pre><p>In this case, we should keep strings tag in a single line.</p><p>Note: Try closing and opening the IDE</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3J4t3eW_a82YXe0Kr_jPvA.png" /></figure><p>Even then, if this issue is not fixed try using the following plugin to add the necessary usage descriptions:</p><pre>cordova plugin add cordova-plugin-media-capture</pre><p>To add these entries into the info.plist, you can use the edit-config tag in the config.xml like this:</p><pre>&lt;edit-config target=&quot;NSCameraUsageDescription&quot; file=&quot;*-Info.plist&quot; mode=&quot;merge&quot;&gt;<br>    &lt;string&gt;need camera access to take pictures&lt;/string&gt;<br>&lt;/edit-config&gt;</pre><pre>&lt;edit-config target=&quot;NSMicrophoneUsageDescription&quot; file=&quot;*-Info.plist&quot; mode=&quot;merge&quot;&gt;<br>    &lt;string&gt;need microphone access to record sounds&lt;/string&gt;<br>&lt;/edit-config&gt;</pre><p>“Remove” and “Add” ios platform again:</p><pre>ionic cordova platform remove ios<br>ionic cordova platform add ios</pre><p>In my opinion, we should not depend on a different plugin for just adding usage descriptions. so I just removed the plugin and added the necessary tags to plugin.xml. Removed and added the ios platform again. It worked seamlessly!!..</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec72fec2efcf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ionic5: Cordova Custom Plugin for Swift]]></title>
            <link>https://medium.com/@durgavundavalli/ionic5-cordova-custom-plugin-for-swift-2e5d3825171f?source=rss-880adad257a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e5d3825171f</guid>
            <category><![CDATA[cordova-plugin]]></category>
            <category><![CDATA[ionic-5]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[cordova]]></category>
            <dc:creator><![CDATA[Durga Vundavalli]]></dc:creator>
            <pubDate>Mon, 13 Apr 2020 20:05:44 GMT</pubDate>
            <atom:updated>2020-04-15T18:39:58.712Z</atom:updated>
            <content:encoded><![CDATA[<p>We can quickly create a basic plugin structure using the Plugman tool. This tutorial will give you a step by step procedure to create a custom plugin in Cordova.</p><p>To install Plugman you need to have node installed in your system. You can download the node from <a href="https://nodejs.org/en/download/">here</a>.</p><p>Install Plugman globally using the following command so that it is available from any directory</p><pre>npm install -g plugman</pre><p>Once you have installed Plugman you can create a plugin in your respective location(Desktop may be). Use the following commands in your terminal</p><pre>$ cd Desktop/<br>$ plugman create --name &lt;pluginName&gt; --plugin_id &lt;pluginId&gt; -- plugin_version 1.0.0</pre><p>Replace &lt;pluginName&gt;, &lt;pluginId&gt; with your names. For reference:</p><pre>plugman create --name PluginSwiftDemo --plugin_id cordova-plugin-pluginswiftdemo --plugin_version 1.0.0</pre><p>To add a platform you need to be in the PluginSwiftDemo folder you just created. Add the required platform to your plugin, in our case it is ios</p><pre>$ cd PluginSwiftDemo/<br>$ plugman platform add --platform_name ios // Android</pre><p>For npm, create a package.json file using the following command:</p><pre>plugman createpackagejson .</pre><p>Upon entering the above command, the terminal will ask you for some details. Enter the required details if you would like to modify or just keep pressing enter key the default once will be considered. Here is my screenshot for reference.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lCblvUwRZQGsKUKZCAhNBA.png" /></figure><p>By following the above steps you have now created a basic plugin structure with the necessary platforms. Open PluginSwiftDemo in your IDE and look for the following folder structure. In our case, as we have added only ios platform <strong>src</strong> folder will contain only <strong>ios</strong> and default objective C class.</p><p><strong>www</strong> folder will have a common interface that exposes the native methods to your Javascript framework.</p><p><strong>PluginDemo.js:</strong> exec(success, error, ‘PluginDemo’, ‘coolMethod’, [arg0]);</p><p>Add the following to your PluginSwiftDemo.js file</p><pre>var exec = require(&#39;cordova/exec&#39;);</pre><pre>var PluginSwiftDemo = function () { }; // This just makes it easier for us to export all of the functions at once.<br>// All of your plugin functions go below this. <br>// Note: We are not passing any options in the [] block for this, so make sure you include the empty [] block.</pre><pre>PluginSwiftDemo.coolMethod = function (arg0, onSuccess, onError) {<br>    exec(onSuccess, onError, &quot;PluginSwiftDemo&quot;, &quot;coolMethod&quot;, [arg0]);<br>};<br>module.exports = PluginSwiftDemo;</pre><p>exec(&lt;successFunction&gt;, &lt;failFunction&gt;, &lt;service_name&gt;, &lt;action&gt;, [&lt;args&gt;]);</p><p>This will marshal a request from the UIWebView to the iOS native side, more or less boiling down to calling the action method on the service class, with the arguments passed in the args Array.</p><p>JavaScript exec call service_name and the name of the Swift class of the plugin should match.</p><p>JavaScript exec call action and the name of the Swift function of the plugin should match.</p><p>Without this added, the plugin may compile but will not be reachable by Cordova.</p><p>Delete the <strong>PluginSwiftDemo.m </strong>file that was created automatically and add the <strong>PluginSwiftDemo.swift</strong> file in the plugin.</p><p><strong>PluginSwiftDemo.swift</strong> is a basic class extended from CDVPlugin.</p><p>“ <em>coolMethod</em> “ method that returns the result based on the arg passed to it. Creates CDVPluginResult success/error and returns it with self.commandDelegate. Arguments passed are read from CDVInvokedUrlCommand context</p><pre>//<br>//  PluginSwiftDemo.swift<br>//  MyApp<br>//<br>//  Created by Durga Vundavalli on 08/04/20.<br>//<br><a href="http://twitter.com/objc">@objc</a>(PluginSwiftDemo) class PluginSwiftDemo : CDVPlugin {<br>  <a href="http://twitter.com/objc">@objc</a>(coolMethod:)<br>  func coolMethod(_ command: CDVInvokedUrlCommand) {<br>    <br>    let msg = command.arguments[0] as? String ?? &quot;Error&quot;<br>    print(msg)<br>   var pluginResult = CDVPluginResult(<br>      status: CDVCommandStatus_ERROR,<br>      messageAs: msg<br>    )<br>if msg.count &gt; 0 {<br>      pluginResult = CDVPluginResult(<br>        status: CDVCommandStatus_OK,<br>        messageAs: msg<br>      )<br>    }<br>self.commandDelegate!.send(<br>      pluginResult,<br>      callbackId: command.callbackId<br>    ) <br>  }<br>}</pre><p><strong>plugin.xml</strong> is where we configure all our iOS related information like source files, resource files, frameworks, assets, permissions(like camera, microphone), etc we will see how to configure all these in the coming tutorials.</p><p>For ease of accessing the plugin change the &lt;clobbers&gt; tag as following in plugin.xml</p><pre>&lt;js-module name=&quot;PluginSwiftDemo&quot; src=&quot;www/PluginSwiftDemo.js&quot;&gt;<br> &lt;clobbers target=&quot;PluginSwiftDemo&quot; /&gt;<br>&lt;/js-module&gt;</pre><p>Change the source file name to swift</p><pre>&lt;source-file src=&quot;src/ios/PluginSwiftDemo.swift&quot; /&gt;</pre><p>For Swift to be supported in Cordova, we have to add a <a href="https://www.npmjs.com/package/cordova-plugin-add-swift-support">swift support library</a> to our application. We will be adding it as a dependency in our plugin.xml so that when we add the plugin, dependencies will also be added to the application.</p><p>Use the following tag to add the dependencies to plugin.xml file in &lt;platform&gt;</p><pre>&lt;dependency id=”cordova-plugin-add-swift-support” version=”2.0.2&quot; /&gt;</pre><p>To make use of the latest version of Swift add the following in config.xml in &lt;platform&gt;</p><pre>&lt;preference name=”UseSwiftLanguageVersion” value=”5&quot; /&gt;</pre><p>Now, we are done with creating a plugin. We can add the plugin to our project in different ways. I choose to make it available on GitHub at <a href="https://github.com/durga0303/PluginSwiftDemo.git">https://github.com/durga0303/PluginSwiftDemo.git</a></p><p>we can install this in our application with the following command</p><pre>cordova plugin add https://github.com/durga0303/PluginSwiftDemo.git</pre><p>We can access the native methods defined in the plugin with a simple service class but with this approach, I have faced some issues in Ionic 5.</p><p>To avoid those issues with Ionic 5, We will be creating a wrapper for our plugin and access it in our application.</p><p>Wrapper creation is explained in detail <a href="https://medium.com/@durgavundavalli/cordova-create-a-native-wrapper-with-ionic-native-d88fbc6742a2">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e5d3825171f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cordova: Create a Native wrapper with ionic-native]]></title>
            <link>https://medium.com/@durgavundavalli/cordova-create-a-native-wrapper-with-ionic-native-d88fbc6742a2?source=rss-880adad257a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/d88fbc6742a2</guid>
            <category><![CDATA[ionic]]></category>
            <category><![CDATA[cordova]]></category>
            <category><![CDATA[ionic-native]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[cordova-plugin]]></category>
            <dc:creator><![CDATA[Durga Vundavalli]]></dc:creator>
            <pubDate>Mon, 13 Apr 2020 19:59:35 GMT</pubDate>
            <atom:updated>2020-04-27T10:02:13.945Z</atom:updated>
            <content:encoded><![CDATA[<h3>Ionic5: Create a Native wrapper for Cordova plugin — ionic-native</h3><p>In this post, we will be creating a wrapper for the Cordova plugin created in my previous posts. Please choose your iOS preferred language <a href="https://medium.com/@durgavundavalli/ionic5-cordova-custom-plugin-for-objective-c-e4e82c5fbc3b">Cordova Objective C</a> or <a href="https://medium.com/@durgavundavalli/ionic5-cordova-custom-plugin-for-swift-2e5d3825171f">Cordova Swift</a>.</p><pre>Note: <em>If you have followed</em> <a href="https://medium.com/@durgavundavalli/ionic5-cordova-custom-plugin-for-objective-c-e4e82c5fbc3b"><em>Objective C</em></a><em>, use PluginName as </em><strong><em>PluginDemo </em></strong><em>and</em><strong><em> git url</em></strong><em>:</em><strong><em> </em></strong><a href="https://github.com/durga0303/PluginDemo.git">https://github.com/durga0303/PluginDemo.git</a><em>. <br>If you have followed </em><a href="https://medium.com/@durgavundavalli/ionic5-cordova-custom-plugin-for-swift-2e5d3825171f"><em>Swift</em></a><em> use, PluginName as </em><strong><em>PluginSwiftDemo </em></strong><em>and</em><strong><em> git url: </em></strong><a href="https://github.com/durga0303/PluginSwiftDemo.git">https://github.com/durga0303/PluginSwiftDemo.git</a></pre><p>Ionic Native wraps plugin callbacks in a Promise or Observable, providing a common interface for all plugins and making it easy to use plugins with Angular change detection.</p><p>I will be creating a wrapper using the Ionic native application available <a href="https://github.com/ionic-team/ionic-native">here</a>. Please clone the application(<a href="https://github.com/ionic-team/ionic-native">ionic-native</a>) to a location of your preference.</p><p>Open the cloned application in your IDE, I’m using <a href="https://code.visualstudio.com/download">Visual Studio Code</a>. If you like to install it check out this <a href="https://code.visualstudio.com/download">link</a>.</p><pre>npm install</pre><pre>// Call this command, and replace <strong>PluginName</strong> with the name of the plugin you wish to add<br>// Make sure to capitalize the first letter, or use CamelCase if necessary.<br> <br>gulp plugin:create -n <strong>PluginName</strong><br><br>// add -m flag to get a minimal template to start with<br>gulp plugin:create -m -n <strong>PluginName</strong></pre><p>I used the <strong>PluginName</strong> same as the plugin we created. so after executing the command check for the basic wrapper structure created at /src/@ionic-native/plugins/ and check for PluginName: /src/@ionic-native/plugins/plugin-demo</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*FOYCGA-MJ9MVGCq1U7CRcA.png" /></figure><p>Open index.ts in the plugin-demo folder you just generated and add the necessary information about the plugin.</p><pre>@Plugin({<br>pluginName: ‘PluginDemo’, //<strong>name of the Plugin we created earlier</strong><br>plugin: ‘cordova-plugin-plugindemo’, // <strong>refer to &quot;id&quot; in package.json of Plugin</strong><br>pluginRef: ‘PluginDemo’, <strong>// the variable reference to call the plugin - refer to plugin.xml of your PluginDemo</strong><br>repo: ‘https://github.com/durga0303/PluginDemo.git&#39;, //<strong>GitHub url</strong><br>install: ‘’, // OPTIONAL in case the plugin requires variables<br>installVariables: [], // OPTIONAL the plugin requires variablesplatforms: [‘iOS’] // example: <strong>[‘Android’, ‘iOS’]</strong><br>})</pre><pre><a href="http://twitter.com/Injectable">@Injectable</a>()<br>export class PluginDemo extends IonicNativePlugin {</pre><pre>/**<br>   * This function does something<br>   * <a href="http://twitter.com/param">@param</a> arg1 {string} Some param to configure something<br>   * <a href="http://twitter.com/return">@return</a> {Promise&lt;any&gt;} Returns a promise that resolves when something happens<br>   */<br> <strong> </strong><a href="http://twitter.com/Cordova"><strong>@Cordova</strong></a><strong>()<br>  coolMethod(arg1: string): Promise&lt;any&gt; {<br>    return; // We add return; here to avoid any IDE / Compiler errors<br>  }</strong></pre><pre>}</pre><p>if there is an error like: Cannot find module ‘<a href="http://twitter.com/ionic">@ionic</a>-native/core’. Run the following command</p><pre>npm install <a href="http://twitter.com/ionic">@ionic</a>-native/core — save</pre><p>After you declare all your methods, You need to run npm run build in the ionic-native project, this will create a dist directory. The dist directory will contain a sub directory @ionic-native with all the packages compiled in there. Copy the package(s) you created/modified to your <strong>app’s</strong> node_modules under the @ionic-native directory.</p><p>After all this process, you have created a Plugin and Plugin Wrapper. It’s time to use them in your application. After you copy the wrapper from the dist directory into node_modules under the @ionic-native directory. The structure will be as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*yPDdVKlmjX0sZ4DJeRGzDA.png" /></figure><p><strong>Test your plugin using the following:</strong></p><pre>import { PluginDemo } from &#39;@ionic-native/plugin-demo/ngx&#39;;</pre><pre>//get the reference to plugin<br>constructor(public pluginDemo: PluginDemo) {}</pre><pre> alert() {<br>    this.pluginDemo.coolMethod(&#39;Alert called&#39;).then(result =&gt; {<br>      alert(result);<br>    }).catch(err =&gt; alert(&#39;Error : &#39; + err));<br>  }</pre><p>Add the plugin to your project:</p><pre>cordova plugin add <a href="https://github.com/durga0303/PluginDemo.git">https://github.com/durga0303/PluginDemo.git</a></pre><pre>Note: if you see any issue like: Current working directory is not a Cordova-based project. Use the following</pre><pre>sudo npm -g install cordova<br>ionic cordova platform list<br>ionic cordova platform add ios</pre><p>To Run on your device:</p><pre>cordova run ios</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*oxwLSKuOLPg1t18hcXlVBg.jpeg" /></figure><p>if you have made any changes to your plugin, push the changes to your repo and add it again in the application.</p><pre>cordova plugin remove cordova-plugin-plugindemo<br>cordova plugin add <a href="https://github.com/durga0303/PluginDemo.git">https://github.com/durga0303/PluginDemo.git</a></pre><p>To remove and add the platform use the following:</p><pre>cordova platform remove ios<br>cordova platform add ios</pre><p>You can learn more about ionic-native <a href="https://github.com/ionic-team/ionic-native/blob/master/DEVELOPER.md">here</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d88fbc6742a2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[iPhone keeps disconnecting and connecting to the computer]]></title>
            <link>https://medium.com/@durgavundavalli/iphone-keeps-disconnecting-and-connecting-to-the-computer-251eaba2a79b?source=rss-880adad257a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/251eaba2a79b</guid>
            <category><![CDATA[ipad]]></category>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[iphone]]></category>
            <category><![CDATA[usb]]></category>
            <category><![CDATA[apple]]></category>
            <dc:creator><![CDATA[Durga Vundavalli]]></dc:creator>
            <pubDate>Thu, 09 May 2019 07:42:19 GMT</pubDate>
            <atom:updated>2019-05-09T07:42:19.470Z</atom:updated>
            <content:encoded><![CDATA[<p>When I connect my iPhone to a Mac for data transfer/Xcode debugging the iPhone starts disconnecting and connecting (the battery icon indicates it),</p><p>I thought that this was a cable issue, because If I adjust the cable in a certain position then it works, but I realized that it is not because of the cable because:</p><p>I bought brand new cables. I cleaned the USB port of the Mac. But still, nothing is working! It is really annoying.</p><p>Sometimes it gets fixed if I unplug &amp; reinsert the USB like 5–7 times.</p><p><strong>How did I solve this issue?</strong></p><p>I think this is not the problem with the device/Mac port/USB cable.</p><p>This seems to be an issue with usbd in Mac OS. The following can solve the issues:</p><p>Open Activity Monitor -&gt; View -&gt; All Processes -&gt; Search for usbd -&gt; Double click -&gt; Quit -&gt; Force Quit</p><p><strong>Using terminal:</strong></p><p>sudo killall -STOP -c usbd will pause the issue related process</p><p>If you want to resume the process for any reason use the following command</p><pre>sudo killall -CONT usbd</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=251eaba2a79b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>