Send notification on Android, iOS and Web using FCM

Few month before Google has launched its new cloud messaging platform Firebase Cloud messaging which will replace its current cloud messaging system Google Cloud Messaging. Gogle has not yet deprecated GCM but it has stopped support on this platform and suggested all developers to use FCM from now onward.

Although google has provided interface to send FCM notification from its console itself but there are some limitations. Actually google has divided notification system in two types:

  1. Notification message
  2. Data messages

=&0=& is simple message which contains a text which will be displayed in the notification area of the device along with some other fields like notification title and display icon. We don’t need to handle them on client app. FCM will catch and display it automatically. This type of message can be sent directly from FCM Console. Just select your project and go to notification tab.

A notification message will look like this:

{
    "to" : "yourclientregistrationid...",
    "notification" : {
      "body" : "notification body",
      "title" : "notification title",
      "icon" : "displayicon"
    }
}

=&1=& are more powerful where we can send any data we want to send in json format. Maximum payload for data messaged could be 4KB. This type of message need to be send via your own code.

A data message will look similar to this:

{
    "to" : "yourclientregistrationid...",
    "data" : {
      "field1" : "your content",
      "field2" : "your content",
      "field3" : "your content"
    }
}

You can see the notification is replaced by data and unlike notification there can be any number of field with any name which you can handle in your client app code.

In next Article we will discuss how to send data notification in C# and PHP

Opencart vQmod before, after and replace operation including index and offset

In my previous article I explained how to install vQmod in Opencart and after installing vQmod we will discuss in this article that how to do modification in Opencart using vQmod.

For making changes in opencart file using vQmod we have to create an XML file with below format

<?xml version="1.0" encoding="utf-8"?>
<modification>
<id><![CDATA[Extension Name]]></id>
<version><![CDATA[Extension Version]]></version>
<vqmver><![CDATA[Minimum vQmod version needed]]></vqmver>
<author><![CDATA[Extension Author]]></author>
<website>Extension Author Website</website>
<file name="file URL to modify">
<operation>
<search position="before/after/replace" offset="for replace" index="occurrence no to replace"><![CDATA[code of line for reference of the modification]]></search>
<add><![CDATA[
Line of code to add (before or after) or replace
]]></add>
</operation>
</file>
</modification>

Now lest understand each tag and attribute of this XML file.

  • modification – Main root tag of the xml file containing rest of the definition of vqmod file
    • id – This is the unique name for your extension
    • version – Your extension version
    • vqmver – vQmod extension version needed to run your extension
    • author – Author name
    • website – Extension website
    • file – Details of the file or files to modify and changes to be done
      • name (attribute) – Url of the file to modify for example starting from website root (not with server drive)
      • operation – All details of change to to in specified file(s).
        • search – Specify like of code to take as reference for add or replace operation
          • position – operation type that is adding code before or after specified line or replace specified line
          • offset – This property is used only then position is set to replace. In this property you can specify how many lines after specified line (in search node) need to be replaced.
          • index – Here we can specify which occurrence of code line specified need to be modified

          add – Here you can specify the code that you want to add or replace as per defined rules.

          1. Add any code before specific line in any file
            <?xml version="1.0" encoding="utf-8"?>
            <modification>
            <id><![CDATA[Add extra information in invoice]]></id>
            <version><![CDATA[1.0.0.0]]></version>
            <vqmver><![CDATA[2.16]]></vqmver>
            <author><![CDATA[edunyte.com]]></author>
            <website>https://edunyte.com</website>
            <file name="admin/view/template/sale/order_invoice.tpl">
            <operation>
            <search position="before" index="1"><![CDATA[<b><?php echo $text_telephone; ?></b> <?php echo $order['store_telephone']; ?><br />]]></search>
            <add><![CDATA[
            <?php echo "Extra Field: Field Value" ?><br />
            ]]></add>
            </operation>
            </file>
            </modification>

            Above code will add an extra line of content on invoice before specified line and for that we have directly added content in invoice template file. Using index attribute we can specify on which occurrence of specify code we want to add content.

          2. Add any code after specific line in any file
            <?xml version="1.0" encoding="utf-8"?>
            <modification>
            <id><![CDATA[Add extra information in invoice]]></id>
            <version><![CDATA[1.0.0.0]]></version>
            <vqmver><![CDATA[2.16]]></vqmver>
            <author><![CDATA[edunyte.com]]></author>
            <website>https://edunyte.com</website>
            <file name="admin/view/template/sale/order_invoice.tpl">
            <operation>
            <search position="after" index="1"><![CDATA[<b><?php echo $text_telephone; ?></b> <?php echo $order['store_telephone']; ?><br />]]></search>
            <add><![CDATA[
            <?php echo "Extra Field: Field Value" ?><br />
            ]]></add>
            </operation>
            </file>
            </modification>

            Above code will add an extra line of content on invoice after specified line and for that we have directly added content in invoice template file. Using index attribute we can specify on which occurrence of specify code we want to add content.

          3. Replace some code with yours in any file
            <?xml version="1.0" encoding="utf-8"?>
            <modification>
            <id><![CDATA[Add extra information in invoice]]></id>
            <version><![CDATA[1.0.0.0]]></version>
            <vqmver><![CDATA[2.16]]></vqmver>
            <author><![CDATA[edunyte.com]]></author>
            <website>https://edunyte.com</website>
            <file name="admin/view/template/sale/order_invoice.tpl">
            <operation>
            <search position="replace" index="1" offset="1"><![CDATA[<b><?php echo $text_telephone; ?></b> <?php echo $order['store_telephone']; ?><br />]]></search>
            <add><![CDATA[
            <?php echo "Extra Field 1: Field Value 1" ?><br />
            <?php echo "Extra Field 2: Field Value 2" ?><br />
            ]]></add>
            </operation>
            </file>
            </modification>

            This is the sample code to replace any line of code with your own code. In above example we have replaced telephone number with our own two line code. See that we have specified offset to 1, this means that this code will replace telephone number along with its next line in invoice template file. As we have explained above that index means which occurrence of specified line of code will be replaced. If we do not specify index attribute then this code will replace all occurrence of specified line in given file.

Getting Started with Opencart customization – Installing vQmod in OpenCart

If you are an Opencart developer and want to make some changes or want to develop any extension for opencart then easiest way for doing this is vQmod. Though Opencart has integrated OCmod in its 2.x versions but still many of developers still like vQmod.

So here we go with installing vQmod in Opencart.

1. First of all we have to download vQmod from github. Heer is the link from where you can download latest vQmod for Opencart files

2. Now extract this zip archive and upload vqmod folder to your Opencart site’s root

3. After uploading this folder make sure that you have given 755 permission to index.php file in your website root and index.php file of admin folder. Don’t worry you can change this permission back to original later.

This write permission on both index.php needed because when we will install vQmod it will do some changes in thee two files.

Along with this you also have to give 755 permission to vqmod folder and apply it to all its sub folders.

4. Now open vQmod install.php file, its url will be like this http://yourstore.com/vqmod/install.php

If you have not given 755 permission to both the index.php files then vqmod install.php will show you message that these files are not writeable.

If even after setting 755 permission you are getting this message then give 777 permission to both index files and vqmod folder along with its sub folders and files.

I hope this article will help you getting started with vQmod in Opencart. In our next article I will explain all basic operation in vQmod for Opencar.

Setup remote access to IISExpress visual studio on LAN

Many times you might need to access your under development site on other computer of your local network. I mostly required this thing to debug my application on mobile devices or webview mobile apps.

Main problem that one face to access under development site on other network computers that their development web server is IIS Express which doesn’t allows access to remote computers to your site.

=&0=&

So for doing this on my machine I searched for solution and found some which didn’t worked for me but later when I did hit and trial with those solutions I got this working for me. So for other developers who might be facing similar situations I am wroting this article to follow these steps to access IIS Express site on remote computer.

Step 1 – Run command prompt as administrator (yeah you read it right, you need administrator permissions to run this command) and run below command:

netsh http add urlacl url=http://edunyte/ user=everyone

Not to mention that you have specify your application url in place of http://edunyte/ in above command. This url could be anything like your system name (like we have placed above) or you system IP address like http://192.168.1.10/. You also have to specify the port in above command if your application is not running on default http port that is port 80.

Here is one sample of command if you are using IP and any port other then default http port:

netsh http add urlacl url=http://192.168.1.10:8080/ user=everyone

You an also specify the user name our user group to which you want to give access to this site remotely, for this you have to specify the user or user group name in place of everyone in above command. See the example below:

netsh http add urlacl url=http://edunyte:8080/ user=dilip

If you want to remove any previously added url just run below command by replacing our url with your (as explained above)

netsh http delete urlacl url=http://edunyte:8080/

Step 2 – Open applicationhost.config file from Documents/IISExpress/config and replace

<binding protocol="http" bindingInformation="*:8080:localhost" />

with

<binding protocol="http" bindingInformation="*:8080:edunyte" />

or

<binding protocol="http" bindingInformation="*:8080:192.168.1.10" />

Use any option from above two based on you are using IP or system name for your site

Step 3 – In Visual Studio go to your project properties, select web and change project url from http://localhost:8080/ to http://dilip-pc:8080/ or http://192.168.1.10:8080/ (use name method which you used for binding in applicationhost.config and to register url through cmd)

Step 4 – This is a not to miss step you you have firewall on your development machine. Add inbound rule to allow incoming connection on your application port (in our case it is 8080). After adding this firewall rule only you can access your application on remote system.

Step 5 – Stop IIS Express by right click on tray icon and selecting exit. Now run you application in visual studio and try to open it on other system on network. For this just type your application url as http://edunyte:8080/ or http://192.168.1.10:8080/ (again this url depends on you configuration above).

Frankly speaking I was not able to access my IIS Express site on my mobile device using machine name so I am using it though IP right now. But actually same procedure should work for both that is IP and machine name.

Ecommerce SaaS platforms and Kartrocket Review (millions negative) – Part 2

For those who don’t want to read complete article and want to ask my opinion about Kartrocket? My answer will be a =&0=&
=&1=& =&2=&

This is the first time I am writing any review and I have decided to do it because I was literally frustrated with the service I paid for.

Even after reading so many negative reviews about Kartrocket I pushed myself to register an account with them for 15 day trial which was later extended to 30 days and then I paid them 3 months subscription about which was around INR 10000. Now you might think that how fool I am that even after knowing all the service issue I registered my store with the, but if you can read my previous article then you will understand why I opt for Kartrocket service.

Oh yes, I forgot to tell one thing that they asked me that how I would like to pay? Monthly, Quarterly, Half Yearly orYearly. So I thought completely setting up store will take a month itself to I should go for at least 3 months. That is how I opt for 3 months subscription.

After registration and paying the amount they assigned a ‘go live’ expert to me so that he can assist and help me to go live as soon as possible. I was expecting this guy to be a knowledge person about their product and service because their sales person gave me this impression, but things were totally different. That go live manager didn’t replied to my calls for 2 days. Really? This is how I will go live ASAP?

Their system is developed on Opencart and deployed on AWS. Mostly they have all the default Opencart features along with some free extensions installed. They also did some customization and this broke complete system and added bugs in it.

I am a developer and so I know all the technical aspects and difficulties of any software product and I can even manage to resolve some of them if I get access to their code and database but because they just give you admin panel and store so I was not able to resolve these issue myself. So I called the sales person again to complain about manager and after that sales person conveyed my serious feedback than I got a call from him but issues were not resolved.

After few days I sent few of my issue via email and didn’t get the reply for few days.

One issue was that I was uploading product images which were around 200 KB in size but after uploading I save the file again on my desktop and found that every image size was increased by almost 100 to 200 KB. This was a serious issue because all my images were already big sized and their code was increasing it size even higher. So ultimately it was increasing my website load time and this issue was never resolved even after my 3 months subscription was completed and I moved to my own server and platform.

I even faced several incidents when I reported serious bugs which were block level issues where I was not even able to process my orders but they didn’t took action for more than 5 days. They also refused to resolve issues on weekends as they have weekend off even if the save issue was pending for complete week.

So if you would as my opinion about Kartrocket? My answer will be a =&0=&
=&1=& =&2=&

Ecommerce SaaS platforms and Kartrocket Review (millions negative) – Part 1

From  past few years, I was planning to start an e-commerce site for some specific products, but only problem was I was busy and can not develop this portal myself. So I searched for some e-commerce platform available for the Indian market and luckily I found some like Shopify, Zepo, Kartrocket, Martjack, BoostMySale and many more. Actually list was quite big but I search in detailed only for these few.

Zepo and Martjack were developed on .NET so being a .NET developer I was having a soft corner for them, but none of them provide the source code of their platform, so I left that soft corner in a deep corner.

After researching for few weeks even after reading so many negative reviews of Kartrocket I registered for it. The reason was clear that all features I was looking for were only available in this platform. Initially my first choice was Shopify but because they do not provide checkout process on your own store domain (all orders on shopify store redirect to Shopify checkout page for payment) which was obviously not a good idea for making any brand, customers will easily know that I am using some other platform for my store.

After that, I searched for Zepo because it was cheap and still providing all the features but the only problem I found was they do not have good store themes. They hardly provide 30 to 40 themes to choose from and from then only 8 to 10 themes were responsive. Everybody knows that most of the users use internet on their smartphones or tablets so the responsive theme was a must. So I rejected that too.

Similarly after researching for other options I finalized Kartrocket because they were at least providing me everything that I wanted (I was not thinking seriously about their negative service reviews because their feature list was stopping to see that). But beleave me that was the biggest mistake of my life.

Now if I have to rethink on all the options then think I should go for Shopify, because if it used worldwide and I didn’t find any such negative reviews.

Read the second part for detailed review of kartrocket here on my next post.