我正在寻找一种方法来做一个"部分"在现有的屏幕/时间板上更新。通过" partial",我的意思是将一些小部件添加到现有的屏幕/时间板,而不会消除已经存在的现有小部件。
考虑以下示例:
创建屏幕:
import { OneSignal } from '@ionic-native/onesignal';
constructor(public one: OneSignal) {
this.bs = firebase.database().ref('/usuarios');
this.usuarioid = firebase.auth().currentUser.uid;
this.one.getIds().then((ids) => {this.one_id = ids.userId,
this.bs.child(this.usuarioid).update({idOneSignal: this.one_id})});
}
更新广告牌:
require 'dogapi'
api_key = "..."
application_key = "..."
board = {
"width" => 1024,
"height" => 768,
"board_title" => "bjusufbe dogapi test",
"widgets" => [
{
"type" => "image",
"height" => 20,
"width" => 32,
"y" => 7,
"x" => 32,
"url" => "https://path/to/create_image.jpg"
}
]
}
dog = Dogapi::Client.new(api_key, application_key)
result = dog.create_screenboard(board)
当我运行create和更新示例时,require 'dogapi'
api_key = "..."
application_key = "..."
board_id = "..."
board = {
"width" => 1024,
"height" => 768,
"board_title" => "bjusufbe dogapi test",
"widgets" => [
{
"type" => "image",
"height" => 20,
"width" => 32,
"y" => 7,
"x" => 32,
"url" => "https://path/to/update_image.jpg"
}
]
}
dog = Dogapi::Client.new(api_key, application_key)
result = dog.update_screenboard(board_id, board)
小部件将覆盖update_image
小部件,这是我试图避免的问题。