Amplify is used to prompt users for feedback at the right times. Based on ruled defined by us library determines the right time to ask for feedback and based on their reaction, users are given choice to leave a quick rating/review on the Huawei App gallery
Inspired from android library https://github.com/stkent/amplify
We can define several rules to determine the right time to prompt for feedback which takes into account the number of days since the app is installed, last asked for feedback, update in the app etc. Library tracks significant events and prompts only when all defined rules allow to do so
In addition to this we can design the layout of the feedback prompt. Users after submitting their feedback are given choice to leave a quick rating/review on the Huawei App gallery
If User gives positive feedback
If we get critical feedback
- For using Amplify module in sample app, include the source code and add the below dependencies in entry/build.gradle to generate hap/support.har.
dependencies {
implementation project(':amplify')
testCompile 'junit:junit:4.12'
}
- For using Amplify module in separate application using har file, add the har file in the entry/libs folder and add the dependencies in entry/build.gradle file.
dependencies {
implementation fileTree(dir: 'libs', include: ['*.har'])
testCompile 'junit:junit:4.12'
}
- For using Amplify from a remote repository in separate application, add the below dependencies in entry/build.gradle file.
dependencies {
implementation 'dev.applibgroup:amplify:1.0.0'
testCompile 'junit:junit:4.12'
}
- Initialize the shared Amplify instance in the MyApplication class and supply feedback collectors that determine where positive and critical feedback should be directed
By default, the HuaweiAppgalleryFeedbackCollector will search their stores for the app whose package name matches the running application. If your app's build variants do not all share a single package name, amplify will fail to load the appropriate App Gallery page in non-release builds. To fix this, pass your release build package name to the FeedbackCollectors during initialization.
- Now we have to add Prompt instance to XML layouts where you may want to prompt the user for their feedback and get the shared Amplify instance in the MainAbilitySlice class and call promptIfReady method and pass the Prompt instance
We have different options to do so, we can have defaultlayout prompt view or custom layout prompt view and can go with default settings or customize according to our need.
a) Default promptview layout with all default settings
b) Default promptview layout with code config
c) Default promptview layout with xml config
d) Custom promptview layout with code config
Here we have to define question view and thanks view xml layout as well
Custom question view
Custom thanks view
- Opening email client when user gives critical feedback with subject & device information in the text already filled, currently opening app gallery for both positive and critical feedback
- Adding custom attributes for CustomlayoutPromptView
- Button customizations by providing different border width and color attributes
Copyright 2015 Stuart Kent
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.